View Single Post
  #4   Report Post  
welshlad
 
Posts: n/a
Default Macro Help In Excel


Thank you for your comments regarding a macro in excel registering how
many rows there are of data.
I took your advice but now this happens : - it registers how many rows
of data there are, but the shading does not move down.

Here's my macro : -

Sub importprint()
'
' importprint Macro
' Macro recorded 14/10/2005 by WP122
'

'
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
For i = 2 To lastrow

With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Selection.Interior.ColorIndex = xlNone

Next i
End Sub


(I want the macro to highlight the first row, highlight it, print it,
then de-highlight it, then move on to the second row and do the same
process etc etc.

Can you help at all?

Regards,

Luke

Don Guillett Wrote:
As always, post your code for comments but to find the last row in col
A

lastrow=cells(rows.count,"a").end(xlup).row
for i=2 to lastrow
your stuff
next i
--
Don Guillett
SalesAid Software

"welshlad"
wrote in message
...

Every morning we have a file imported containing rows of data. There
are
a different amount of entries every day. I have managed to set up a
macro that goes through each row individually highlighting it and
printing it off. Therefore, if I have an import with 20 rows, my
macro
prints off 20 copies, with each row individually being highlighted.

My problem is that I can only do this if I firstly enter into the
macro
how many rows of data there are. Is there any way the macro can work
through the rows, and know when to stop?

Any advice will be gratefully received.


--
welshlad



--
welshlad