|
Subject:
|
Command Button Question
|
|
Posted By:
|
eoghang
|
Post Date:
|
9/24/2006 11:17:19 AM
|
Question from a newbie.
I've created code and debugged it successfully as part of a worksheet object. But when I copied the code to a command button it gives a run-time error. Why can't I simply copy the code from the worksheet to the command button?
It fails at: Rows("1:6").Select
and gives the reason as 'Select method of Range class failed.'
Here are the few lines of code before this line:
' ChDir "D:\" Workbooks.Open Filename:="D:\Export.csv" ' Activate export.csv Windows("Export.csv").Activate ' Modify the contents of the file Rows("1:6").Select
Thank you in advance for your help.
|
|
Reply By:
|
vemaju
|
Reply Date:
|
9/25/2006 2:36:30 AM
|
Hi,
Set your code Rows("1:6").Select like this ActiveSheet.Rows("1:6").Select
-vemaju
|
|
Reply By:
|
eoghang
|
Reply Date:
|
9/25/2006 8:33:24 PM
|
Vemaju; Thank you this helped.
|