If I want to copy a range of cells from one sheet to another sheet in macro operation I use the following codes: 1.sheets ("something").select 2. range("k1:k45").select 3. selection.copy 4. sheets("somethingelse").select. 5. Range("C1").select etc. If I copy these codes and paste in a command button and run, the 5th step code Range("C1") is taken as error. All other macro codes are being accepted as such in command buttons. Why is it so? What is the alternate code?. This happens during paste special operation. The program is running while in macro operation for the same codes. But the same codes when copied and pasted in command button, the program does not run through the click of the command button and an error is displayed due to step 5 above.
2007-08-18
18:41:23
·
4 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design