Tell a macro button which cell to go to

  • Hi all .. Love some help on this.


    I have a Macro Button in Cell AF2 that opens up the next 6 columns [which are hidden]. Rows 2 & 3 have their panes frozen so it acts as a header for column identifiers.


    Each sheet has 100 rows so the officer can be in as low as row 105.


    What I want to do is when they click on the UNHIDE button from cell AG92, once the unhide function completes I would like it to go to AH92 which is the next cell along.


    I have this so far ..


    [vba]
    Sub reassess_open()
    '
    ' reassess_open Macro
    ' Macro recorded 16/12/2005'


    Columns("AG:AM").Select
    Selection.EntireColumn.Hidden = False
    Range("AH5").Select
    End Sub[/vba]


    Instead of going to AH5 I want it to go to the AH value of the row they are in.


    HELP! :?

    Tayler [the blue fox] :thanx:

  • Re: Tell a macro button which cell to go to


    Hi [the blue fox],



    Note you do not have to select the columns to hide or unhide them.


    Code
    Sub reassess_open()
        Columns("AG:AM").EntireColumn.Hidden = False
        Cells(ActiveCell.Row, 34).Select
    End Sub


    Hope this helps

    [FONT="Arial Black"][COLOR="blue"][SIZE="4"]Bill[/SIZE][/COLOR][/FONT]
    Tip: To avoid chasing code always use Option Explicit.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!