ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Difficulty with macro in excel 2007. (https://www.excelbanter.com/excel-programming/413577-difficulty-macro-excel-2007-a.html)

helphelp

Difficulty with macro in excel 2007.
 
I have a website from which I download data and run macros for sorting data.
When I recors a macro in excel 2007, the macro looks for a specific file name
instead of using the active worksheet. For eg:
Sheets("userexport-23").Select. Everytime I download the -23 changes, Please
tell me how I can change the code to make the macro run in any worksheet.
Thanks

Prashanth

Rick Rothstein \(MVP - VB\)[_2229_]

Difficulty with macro in excel 2007.
 
It sure would help if you posted the code you are talking about and also
tell us what the -23 changes to... otherwise, all we can do is take wild
guesses.

Rick


"helphelp" wrote in message
...
I have a website from which I download data and run macros for sorting
data.
When I recors a macro in excel 2007, the macro looks for a specific file
name
instead of using the active worksheet. For eg:
Sheets("userexport-23").Select. Everytime I download the -23 changes,
Please
tell me how I can change the code to make the macro run in any worksheet.
Thanks

Prashanth



Gary Keramidas

Difficulty with macro in excel 2007.
 
wild guess here.

worksheets(1).select if it's always the first worksheet.


--


Gary


"helphelp" wrote in message
...
I have a website from which I download data and run macros for sorting data.
When I recors a macro in excel 2007, the macro looks for a specific file name
instead of using the active worksheet. For eg:
Sheets("userexport-23").Select. Everytime I download the -23 changes, Please
tell me how I can change the code to make the macro run in any worksheet.
Thanks

Prashanth




helphelp

Difficulty with macro in excel 2007.
 
Brilliant Gary. Thanks it works :)

Prashanth

"Gary Keramidas" wrote:

wild guess here.

worksheets(1).select if it's always the first worksheet.


--


Gary


"helphelp" wrote in message
...
I have a website from which I download data and run macros for sorting data.
When I recors a macro in excel 2007, the macro looks for a specific file name
instead of using the active worksheet. For eg:
Sheets("userexport-23").Select. Everytime I download the -23 changes, Please
tell me how I can change the code to make the macro run in any worksheet.
Thanks

Prashanth






All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com