Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
GOTO Using the ()NOW Function Q
I am trying to go to the cell, 2 columns to the right of the cell the
current day is displayed in. I have a list of days of the year in column A, input starts on Column C. I want to initiate the user to go to the 'Current day' via the ()NOW function. Part of the code I wish to use, which will freeze panes etc is below, but not sure the syntax for including the ()NOW function Thanks Application.Goto Range("Schedule!A1"), True ActiveCell.Offset(2, 0).Select ActiveWindow.FreezePanes = True |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
GOTO Using the ()NOW Function Q
You can't use Goto. Look at Find in Help.
-- HTH RP (remove nothere from the email address if mailing direct) "John" wrote in message ... I am trying to go to the cell, 2 columns to the right of the cell the current day is displayed in. I have a list of days of the year in column A, input starts on Column C. I want to initiate the user to go to the 'Current day' via the ()NOW function. Part of the code I wish to use, which will freeze panes etc is below, but not sure the syntax for including the ()NOW function Thanks Application.Goto Range("Schedule!A1"), True ActiveCell.Offset(2, 0).Select ActiveWindow.FreezePanes = True |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
GOTO Using the ()NOW Function Q
I assumed that the dates were in a single column (A) on a worksheet named
Sheet1: Option Explicit Sub testme() Dim res As Variant Dim myRng As Range With Worksheets("sheet1") Set myRng = .Range("a2", .Cells(.Rows.Count, "A").End(xlUp)) res = Application.Match(CLng(Date), myRng, 0) If IsError(res) Then 'not found, what should happen? Else Application.Goto myRng(res), scroll:=True myRng(res).Offset(0, 2).Select ActiveWindow.FreezePanes = True End If End With End Sub John wrote: I am trying to go to the cell, 2 columns to the right of the cell the current day is displayed in. I have a list of days of the year in column A, input starts on Column C. I want to initiate the user to go to the 'Current day' via the ()NOW function. Part of the code I wish to use, which will freeze panes etc is below, but not sure the syntax for including the ()NOW function Thanks Application.Goto Range("Schedule!A1"), True ActiveCell.Offset(2, 0).Select ActiveWindow.FreezePanes = True -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
GOTO Using the ()NOW Function Q
Dave thanks for your post
I've copied your code into a module but nothing is happening. Not sure if I have it within the correct area as the 'Option Explicit' text appears above another Sub I have, I can't get it within the same sub "Dave Peterson" wrote in message ... I assumed that the dates were in a single column (A) on a worksheet named Sheet1: Option Explicit Sub testme() Dim res As Variant Dim myRng As Range With Worksheets("sheet1") Set myRng = .Range("a2", .Cells(.Rows.Count, "A").End(xlUp)) res = Application.Match(CLng(Date), myRng, 0) If IsError(res) Then 'not found, what should happen? Else Application.Goto myRng(res), scroll:=True myRng(res).Offset(0, 2).Select ActiveWindow.FreezePanes = True End If End With End Sub John wrote: I am trying to go to the cell, 2 columns to the right of the cell the current day is displayed in. I have a list of days of the year in column A, input starts on Column C. I want to initiate the user to go to the 'Current day' via the ()NOW function. Part of the code I wish to use, which will freeze panes etc is below, but not sure the syntax for including the ()NOW function Thanks Application.Goto Range("Schedule!A1"), True ActiveCell.Offset(2, 0).Select ActiveWindow.FreezePanes = True -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
goto function in macro 2 | Excel Discussion (Misc queries) | |||
goto function in macro | Excel Discussion (Misc queries) | |||
A goto function for Mobile Excel | Excel Worksheet Functions | |||
Goto statement in an IF function | Excel Worksheet Functions | |||
On Error Goto doesn't goto | Excel Programming |