Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
chose next page
this does work, but i would like to reduce it (as it gets much bigger than
even this): sub test() ActiveSheet.Next.Next.Next.Next.Next.Cells(1, 1) = "ok" end sub i want to choose the 5th sheet down from where i am now. i will not always be on first sheet when running this, nor will i know the name of the 5th sheet down. i was thinking something like: ActiveSheet.Next(5).Cells(1, 1) = "ok" (this does not work) thanks, mike allen |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
chose next page
With no validation:
Option Explicit Sub test() Dim myIndex As Long myIndex = ActiveSheet.Index Sheets(myIndex + 5).Cells(1, 1).Value = "ok" End Sub mike allen wrote: this does work, but i would like to reduce it (as it gets much bigger than even this): sub test() ActiveSheet.Next.Next.Next.Next.Next.Cells(1, 1) = "ok" end sub i want to choose the 5th sheet down from where i am now. i will not always be on first sheet when running this, nor will i know the name of the 5th sheet down. i was thinking something like: ActiveSheet.Next(5).Cells(1, 1) = "ok" (this does not work) thanks, mike allen -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
chose days by month | Excel Discussion (Misc queries) | |||
Chose two printers with vba | Excel Programming | |||
How can I get Excel to automatically chose one of two answers? | Excel Discussion (Misc queries) | |||
Macro to chose what to print | Excel Discussion (Misc queries) | |||
How can I set up to chose more than 1 item from a dropdown list (. | Excel Discussion (Misc queries) |