Closed Thread
Results 1 to 2 of 2

Referencing Sheet Names

  1. #1
    Stuart Grant
    Guest

    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. #2
    JE McGimpsey
    Guest

    Re: Referencing Sheet Names

    Try:

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

    or, somewhat less efficiently (IIRC):

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



    In article <[email protected]>,
    "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 ?


Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1