Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cell Not Updated (XL97:SR2)

    I have two Sheets named: Sheet1 and QtrReport. The following code should update Cell A1 in "QtrReport" irregardless of the active sheet.

    Sub test()
    Sheets("QtrReport").Range(Cells(1, 1), Cells(1, 1)) = "John"
    End Sub

    The code works fine if "QtrReport" is the active sheet but not if "Sheet1" is active.

    Is it me or just Sun Spots?
    John

  2. #2
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Tampico, Tamps, Mexico
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cell Not Updated (XL97:SR2)

    John:

    try this:

    Sheets("QtrReport").Cells(1, 1) = "John"

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cell Not Updated (XL97:SR2)

    Yes, that would work but I'm interested in using the Range(Cells,Cells) functionality.

    Thanks,
    John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cell Not Updated (XL97:SR2)

    Without further qualification, Cells refers to the active worksheet. You must explicitly refer to another worksheet:

    Sheets("QtrReport").Range(Sheets("QtrReport").Cell s(1, 1), Sheets("QtrReport").Cells(1, 1))

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cell Not Updated (XL97:SR2)

    I should have known better...I was hoping it was the "Sun Spots"

    John <img src=/S/invisible.gif border=0 alt=invisible width=15 height=15>

Posting Permissions

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