Results 1 to 6 of 6
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Why... (2000 sr 1)

    You must put a point . before Range("A65536") to indicate that it belongs to With Worksheets("DB"). Without the point, Range("A65536") refers to the active worksheet.
    <code>
    Set oCELL = .Range("A65535").End(xlUp).Offset(1, 0)</code>

  2. #2
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Range refers to wrong worksheet (2000 sr 1)

    With Worksheets("DB")

    Dim oCELL As Range
    Set oCELL = Range("A65535").End(xlUp).Offset(1, 0)
    oCELL.Select

    with this i would want to select a last blank cell in an hided sheet but the routine select the last cell into active wbook...

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Why... (2000 sr 1)

    Hummm...
    But this is a godd metod to select a blank last cell in an hide wsheet?

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

    Re: Why... (2000 sr 1)

    Yes, it is. Actually, it selects the cell below the last used cell in the column. It doesn't matter whether the worksheet is hidden or not.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Why... (2000 sr 1)

    Ok....
    Assuming i have used this
    With Worksheets("DB")

    Dim oCELL As Range
    Set oCELL = Worksheets("DB").Range("A65536").End(xlUp).Offset( 1, 0)
    oCELL.SelectApplication.ScreenUpdating = False
    oCELL = VAR_CI1 & "/" & VAR_CI2 & "/" & VAR_CI3


    and the last blank cell is filled with the joint of variable for example in A188 i would want to go to the first right cell near A188 in this case B188...

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

    Re: Why... (2000 sr 1)

    You don't really need to select cells to set their value. You can do this:

    Dim oCELL As Range
    Set oCELL = Worksheets("DB").Range("A65536").End(xlUp).Offset( 1, 0)
    Application.ScreenUpdating = False
    ' Set the value of the first unused cell in column A
    oCELL.Value = VAR_CI1 & "/" & VAR_CI2 & "/" & VAR_CI3
    ' Set the value of the cell next to it (in column [img]/forums/images/smilies/cool.gif[/img]
    oCELL.Offset(0, 1).Value = ...

    Offset(0, 1) means 0 rows down and 1 column to the right.

Posting Permissions

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