Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am trying to write some code that will search a workbook for a valu given a string. Naturally I am using "Cells.Find(What:=.....". Howeve I need my search string to have a number that is incremented on eac loop and hence I wanted to put my search string into a variable. Unfortunately if I specify the variable after the 'what:' it throws u an error. How can i get around this? ---------------------------------------------------------------- Sub Dates() Dim Grand As String For N = 1 To 47 Grand = "Grand Total" & N Cells.Find(What:=Grand, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByRows SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate ActiveCell = Format(WeekStartDate, "D-MMM") Next N End Su -- mozar ----------------------------------------------------------------------- mozart's Profile: http://www.excelforum.com/member.php...fo&userid=1331 View this thread: http://www.excelforum.com/showthread.php?threadid=39767 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find First Non blank cell than find column header and return that value | Excel Worksheet Functions | |||
Despite data existing in Excel 2002 spreadsheet Find doesn't find | Excel Discussion (Misc queries) | |||
find and delete duplicate entries in two columns or find and prin. | Excel Programming | |||
find and delete text, find a 10-digit number and put it in a textbox | Excel Programming | |||
backwards find function to find character in a string of text | Excel Programming |