You are on page 1of 1

# Set active workbook

- Dim wb As Workbook
Workbooks(wb.Name).Activate
Set wb1 = ActiveWorkbook
- wb1.Activate(this can be used later on since value is stored in
variable)
- Set wb1 = Workbooks.Open(full path including file extension)(another
way to set workbook data to variable)

# Set sheet to show

- Sheets("motors").Visible = True

# Set active sheet

- Worksheets("motors").Activate
- Set ws1 = ActiveWorkbook.Worksheets("Sheet1")

# Remove filters in active sheet

- ActiveSheet.AutoFilterMode = False

# Get last row value in excel sheet

- Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row

# Copy range of cells

- Range("A2:A" & Lastrow).Copy

# Delete all data in active sheet

- Cells.Clear

You might also like