Dynamically Activating Cell
VBA Telemetry pings you when your VBA projects fail
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Dynamically Activating Cell

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I locate a cell and save the positions:
    SaveRow = ActiveCell.Row
    SaveCol = ActiveCell.Column

    If in Row 3, Col B - the values returned will be SaveRow - 3 ; SaveCol 2 (not B)

    The difficulty is returning to, or positioning to, Row/Column Cell using the saved values.

    What is the technique to select or activate a cell when the values are dynamically maintained? (Column is a numeric value.)

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Houston, TX
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    How about this?

    Dim wks As Worksheet

    Set wks = ActiveSheet
    wks.Cells(3, 2).Activate

    Of course, the numbers 3 and 2 can be replaced by variables containing these numbers.

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hi
    SaveRow = ActiveCell.Row
    SaveCol = ActiveCell.Column

    Save your data into Cell B3 as follows:

    SavePlace = Activecell.row & "," & activecell.column

    The string variable will then =
    SavePlace = "3,2"

    Now use this syntax to activate the cell

    Assuming the cell is on the activesheet

    cells(SavePlace).activate
    or
    cells(SavePlace).select

    Tom






    [ This Message was edited by: TsTom on 2002-03-27 09:32 ]

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com