In the program that I am working on, there is an error when the program tries to select a sheet. The code goes like this:
Sheets(dataSheet).select
and dataSheet is a valid sheet. I can't figure this out, what is going on, why is this an error?
In the program that I am working on, there is an error when the program tries to select a sheet. The code goes like this:
Sheets(dataSheet).select
and dataSheet is a valid sheet. I can't figure this out, what is going on, why is this an error?
do you have more than 1 workbook open.
if yes then the active workbook is not the workbook that has the required sheet in it.
try using
workbooks("book1").Sheets(dataSheet).select
or
thisworkbook.Sheets(dataSheet).select
Note:- Your macro will run quicker if you do not select workbooks, sheets, ranges etc.
you can yose code like
workbooks("book1").Sheets(dataSheet)..range("a1")="Hi"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks