A simple 'If...Then...' code needed?

  • Thread starter Thread starter Big Chris
  • Start date Start date
B

Big Chris

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
 
try this

Sub printem()
For Each c In [d1:d6]
If Len(c) > 0 Then
[b10] = c
ActiveSheet.PrintPreview
End If
Next c
End Sub
 
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
 
Thanks guys!! It works!

Your help is very much appreciated.

Thanks again....days saved.....
 
Back
Top