Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JV JV is offline
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,081
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping through a specific column Carlee Excel Programming 1 April 21st 07 12:50 AM
VBA column identifier and looping Robert Excel Programming 2 May 15th 06 02:44 PM
Looping through a column hudson40 Excel Programming 1 August 16th 05 03:31 PM
Looping until empty column theguz Excel Discussion (Misc queries) 1 August 4th 05 07:04 PM
looping from one column to the next Brad Zenner Excel Programming 0 July 21st 03 08:41 PM


All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"