fim
fim

Reputation: 13

how to use ActiveSheet variable?

Dim wsCopy As Worksheet
Dim wsDest As Worksheet
  Set wsCopy = Workbooks(ThisWorkbook.Path).ActiveSheet  <- error
  Set wsDest = Workbooks("aa.xlsx").Worksheets("bb")

it doesn't work...

Upvotes: 1

Views: 103

Answers (1)

Tim Williams
Tim Williams

Reputation: 166885

Set wsCopy = ThisWorkbook.ActiveSheet 

FYI ThisWorkbook.Path is the folder location for the workbook - you'd need Workbooks(ThisWorkbook.Name) if you wanted to go that route (but you don't need to...)

Upvotes: 3

Related Questions