View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default A simple 'If...Then...' code needed?

for each cell in Range("A1:A50").SpecialCells(xlConstants)
cell.offset(0,1).Value = cell.Value
cell.parent.Printout
Next

Assumes the cells have constant values in them. If they will be formulas
for each cell in Range("A1:A50").SpecialCells(xlformulas)
if Cell.Value < "" then
cell.offset(0,1).Value = cell.Value
cell.parent.Printout
End if
Next

--
Regards,
Tom Ogilvy


"Big Chris" wrote in message
...
Please can somebody help?

I want to run a macro which goes to cell a1 and if it is not blank to
copy that cells value into another cell (b1) and print the sheet. I
want then for the macro to move down to the next non-blank cell in
column A and do the same until it's visited all non-blank cells in the
range a1:a50.

I've been struggling with this for days and spent hours seaching the
net, but just can't find an answer.

Thanks in anticipation!!


__________________
Big Chris



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/