Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Stuart Grant
 
Posts: n/a
Default Referencing Sheet Names

It seems so elementary I'm almost ashamed to ask.
I want to copy the ActiveCell.Value to a cell on another sheet in the same
workbook. The sheet is called Q1Trans. I put in the macro
ActiveCell.Copy Destination:=Q1Trans!Range("C101")
At Q1Trans in the macro I get the error message "Variable not defined". I
have tried putting it in parentheses with and without single or double
quotes but again get an error message.
If I substitute Sheet6 for Q1Trans, the macro works.
Why won't it accept the Sheet name as shown on the Tab ?
Stuart


  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Try:

ActiveCell.Copy Destination:=Worksheets("Q1Trans").Range("C101")

or, somewhat less efficiently (IIRC):

Activecell.Copy Destination:=Range("Q1Trans!C101")



In article ,
"Stuart Grant" <sagrantatbluewindotch wrote:

It seems so elementary I'm almost ashamed to ask.
I want to copy the ActiveCell.Value to a cell on another sheet in the same
workbook. The sheet is called Q1Trans. I put in the macro
ActiveCell.Copy Destination:=Q1Trans!Range("C101")
At Q1Trans in the macro I get the error message "Variable not defined". I
have tried putting it in parentheses with and without single or double
quotes but again get an error message.
If I substitute Sheet6 for Q1Trans, the macro works.
Why won't it accept the Sheet name as shown on the Tab ?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying multiple sheets from one book 2 another and undertake spec Pank Mehta Excel Discussion (Misc queries) 14 March 16th 05 04:41 PM
sheet names Paweł Gałecki Excel Discussion (Misc queries) 2 March 4th 05 01:15 PM
Sheet names used in formulas frustratedwthis Excel Discussion (Misc queries) 5 February 25th 05 01:13 PM
printing sheet names Shooter Excel Worksheet Functions 2 December 9th 04 03:19 PM
Graphs and sheet referencing? Graham Excel Worksheet Functions 2 October 31st 04 11:37 PM


All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"