#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Needy Novice
 
Posts: n/a
Default Macro Help

I am new to Excel Macros, but not to Excel. I want to write a macro that
will copy the VALUES in a row to row A1, then print the range "Print", return
to the next row in the worksheet and do it again.

When I recorded my macro, it keeps returning to the first row I copied and
does not go down to the next row and repeat the action.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Macro Help

Maybe something like:

option explicit
sub testme01()

dim FirstRow as long
Dim LastRow as long
Dim iRow as long

with worksheets("sheet1")
firstrow = 2
lastrow = .cells(.rows.count,"A").end(xlup).row
for irow = firstrow to lastrow
.rows(irow).copy
.range("a1").pastespecial paste:=xlpastevalues
.range("Print").printout Preview:=true
next irow
end with

end sub

Needy Novice wrote:

I am new to Excel Macros, but not to Excel. I want to write a macro that
will copy the VALUES in a row to row A1, then print the range "Print", return
to the next row in the worksheet and do it again.

When I recorded my macro, it keeps returning to the first row I copied and
does not go down to the next row and repeat the action.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Needy Novice
 
Posts: n/a
Default Macro Help

You are the best Dave! This worked!! Thanks for your time; I really
appreciate it.

"Dave Peterson" wrote:

Maybe something like:

option explicit
sub testme01()

dim FirstRow as long
Dim LastRow as long
Dim iRow as long

with worksheets("sheet1")
firstrow = 2
lastrow = .cells(.rows.count,"A").end(xlup).row
for irow = firstrow to lastrow
.rows(irow).copy
.range("a1").pastespecial paste:=xlpastevalues
.range("Print").printout Preview:=true
next irow
end with

end sub

Needy Novice wrote:

I am new to Excel Macros, but not to Excel. I want to write a macro that
will copy the VALUES in a row to row A1, then print the range "Print", return
to the next row in the worksheet and do it again.

When I recorded my macro, it keeps returning to the first row I copied and
does not go down to the next row and repeat the action.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Macro Help

Woohoo!!

Glad it worked for you.

Needy Novice wrote:

You are the best Dave! This worked!! Thanks for your time; I really
appreciate it.

"Dave Peterson" wrote:

Maybe something like:

option explicit
sub testme01()

dim FirstRow as long
Dim LastRow as long
Dim iRow as long

with worksheets("sheet1")
firstrow = 2
lastrow = .cells(.rows.count,"A").end(xlup).row
for irow = firstrow to lastrow
.rows(irow).copy
.range("a1").pastespecial paste:=xlpastevalues
.range("Print").printout Preview:=true
next irow
end with

end sub

Needy Novice wrote:

I am new to Excel Macros, but not to Excel. I want to write a macro that
will copy the VALUES in a row to row A1, then print the range "Print", return
to the next row in the worksheet and do it again.

When I recorded my macro, it keeps returning to the first row I copied and
does not go down to the next row and repeat the action.


--

Dave Peterson


--

Dave Peterson
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
Editing a simple macro Connie Martin Excel Worksheet Functions 5 November 29th 05 10:19 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 11:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 01:40 AM


All times are GMT +1. The time now is 01:38 AM.

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"