Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
head spinning loop...
At least it's making my head spin...
Sheet1 has sections so that A32 - A81 is part of one section. I want to loop through all the values in Sheet2, column D and if those values begin with "6" then take the value from the same row in column E and place it in Sheet1 starting from row A32 and filling downward for every instance in Sheet2 where the value begins with "6". Please help! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
head spinning loop...
Give this a try...
Sub CopyStuff() Dim rngToSearch As Range Dim rngFound As Range Dim rngFoundAll As Range Dim strFirstAddress As String Set rngToSearch = Sheets("Sheet2").Columns("D") Set rngFound = rngToSearch.Find(What:="6*", _ LookAt:=xlWhole, _ LookIn:=xlFormulas) If Not rngFound Is Nothing Then Set rngFoundAll = rngFound strFirstAddress = rngFound.Address Do Set rngFoundAll = Union(rngFound, rngFoundAll) Set rngFound = rngToSearch.FindNext(rngFound) Loop Until rngFound.Address = strFirstAddress rngFoundAll.Offset(0, 1).Copy Sheets("Sheet1").Range("A32") End If End Sub -- HTH... Jim Thomlinson "Stephen" wrote: At least it's making my head spin... Sheet1 has sections so that A32 - A81 is part of one section. I want to loop through all the values in Sheet2, column D and if those values begin with "6" then take the value from the same row in column E and place it in Sheet1 starting from row A32 and filling downward for every instance in Sheet2 where the value begins with "6". Please help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cant get my head around this one | Excel Worksheet Functions | |||
I'm over my head on this one... | Excel Programming | |||
Insert spinning button with time format in Excel 2000? | Excel Discussion (Misc queries) | |||
Spinning Numbers | Excel Programming | |||
Spinning numbers | Excel Programming |