0% found this document useful (0 votes)
11 views2 pages

Instructions

The document discusses Excel VBA macros for copying cell values, opening workbooks, getting directory information, and using the immediate window and breakpoints when debugging VBA code.

Uploaded by

Anan Shao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Instructions

The document discusses Excel VBA macros for copying cell values, opening workbooks, getting directory information, and using the immediate window and breakpoints when debugging VBA code.

Uploaded by

Anan Shao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sub copy()

Range("C1").Value = Range("A1").Value

Range("a1").copy

Range("c1").PasteSpecial

End Sub

Pathname: the location of the file

Filename: name of the document + the type of the doc. Xlsmt

Sub openworkbook()

pathname = "C:\Users\User\Desktop\bas sem 2 session 2\Suppiler"

Filename = "Supplier1.xlsm"

Workbooks.Open Filename:=pathname & "\" & Filename

MsgBox "File Opened"

End Sub

Getting the directory

Window and r ,cmd

Cd+space+C:\Users\User\Desktop\bas sem 2 session 2 (enter)

>dir (enter)

>dir > x. txt.

Can copy the data to excel. Use text to convert column. Fixed width.

No difference in insert
Project explorer: every workbook and new sheet is added there

Module is for complicated codes: need to tell the excel where the ranges … are

Immediate

F5  runs the code

F8  step by step

? question mark in immediate window

Break point

Recoding the steps in micro

You might also like