Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping Down a column
I have 2 questions.
First how would I loop down a column starting at cell D3 to cell D250? As it is looping through if cell D25 for example contains text I need it to move over to cell E25 cut the formula and paste it in cell D25. Second scroll down column D again and if cell has a formula I need the whole row to be made bold and have a border on top and one the bottom. Thanks in advance. JV |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping Down a column
Test this on a copy of your workbook
Don't know if this is exactly what you want, but you may be able to tweak it. Dim cell as Range for each cell in Range("D3:D250") if cell < "" then if cell.offset(0,1).HasFormula then s = cell.offset(0,1).Formula cell.offset(0,1).Value = cell.value cell.Value = s cell.EntireRow.font.Bold = True Else cell.offset(0,1).Value = cell.Value cell.ClearContents end if End if Next -- Regards, Tom Ogilvy "JV" wrote: I have 2 questions. First how would I loop down a column starting at cell D3 to cell D250? As it is looping through if cell D25 for example contains text I need it to move over to cell E25 cut the formula and paste it in cell D25. Second scroll down column D again and if cell has a formula I need the whole row to be made bold and have a border on top and one the bottom. Thanks in advance. JV |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping Down a column
Here's a quick example
Const TestText = "text to search for here" Dim cc as range for each cc in range("D3:D250") if cc.text = TestText then cc.formula = cc.offset(0,1).formula next cc "JV" wrote: I have 2 questions. First how would I loop down a column starting at cell D3 to cell D250? As it is looping through if cell D25 for example contains text I need it to move over to cell E25 cut the formula and paste it in cell D25. Second scroll down column D again and if cell has a formula I need the whole row to be made bold and have a border on top and one the bottom. Thanks in advance. JV |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looping through a specific column | Excel Programming | |||
VBA column identifier and looping | Excel Programming | |||
Looping through a column | Excel Programming | |||
Looping until empty column | Excel Discussion (Misc queries) | |||
looping from one column to the next | Excel Programming |