Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default finding the last row for a macro

I want to copy an item from on cell in worksheet3 (CO2) and then paste it in
worksheet1 (CO2) then copy this all the way down to the last row. I would
like to do this in a macro. I have tried recording this several ways, but it
is not reliable.

Also, I would like to go to the bottom row, and fill lastrow,A through
lastrow,colCN with the value of lastrow,A

How would this macro look?

Thanks
Mc


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default finding the last row for a macro

Sub copyrange()

Sheets("sheet1").Range("CO2") = Sheets("sheet3").Range("CO2")
Sheets("sheet1").Activate

Lastrow = Cells(Rows.Count, 1).End(xlUp).Row

Cells(Lastrow, 1).Copy Destination:=Range("B" & CStr(Lastrow) & ":CN" &
CStr(Lastrow))

End Sub

"Mctabish" wrote:

I want to copy an item from on cell in worksheet3 (CO2) and then paste it in
worksheet1 (CO2) then copy this all the way down to the last row. I would
like to do this in a macro. I have tried recording this several ways, but it
is not reliable.

Also, I would like to go to the bottom row, and fill lastrow,A through
lastrow,colCN with the value of lastrow,A

How would this macro look?

Thanks
Mc



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
help finding saved Macro Stonepost Excel Discussion (Misc queries) 1 November 25th 07 11:01 PM
Help for Macro: Finding last cell and selecting it [email protected] Excel Discussion (Misc queries) 4 January 29th 07 08:40 AM
Problem with file finding macro Alf[_8_] Excel Programming 6 June 11th 06 10:04 PM
can anyone help with copy-finding macro? popovsky[_7_] Excel Programming 0 July 20th 05 10:24 AM
finding last line in macro GJR3599 Excel Programming 7 April 6th 05 01:34 PM


All times are GMT +1. The time now is 01:20 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"