Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Need simple macro to copy and paste values

I need to write a macro to copy 2 total cells from the bottom of one sheet
and paste those values into cells on another sheet. The total cells on
"sheet 1" are in Columns C and D and are one row below the last data in
columns A & B. Also, there will be a varying number of rows on "sheet 1" at
different times.

The cells on "sheet 2" that I need to paste the values in are D2 and E2.

This is actually going to be an addition to a current macro that I have
started, but I can't get this simple task to work. :(
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Need simple macro to copy and paste values

This assumes that there is no data in columns A & B below
the Total line.

Sub sl()
Dim lr As Long
lr = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
Range("A" & lr & ":B" & lr).Copy Sheets("Sheet2").Range("D2")
End Sub


"Bern Notice" wrote in message
...
I need to write a macro to copy 2 total cells from the bottom of one sheet
and paste those values into cells on another sheet. The total cells on
"sheet 1" are in Columns C and D and are one row below the last data in
columns A & B. Also, there will be a varying number of rows on "sheet 1"
at
different times.

The cells on "sheet 2" that I need to paste the values in are D2 and E2.

This is actually going to be an addition to a current macro that I have
started, but I can't get this simple task to work. :(



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
Simple Macro - I think... Copy - Paste on Click Scott Campbell[_2_] Excel Discussion (Misc queries) 5 November 14th 12 12:52 AM
simple copy paste multiple range macro ARGUMENT ERROR Bruno Excel Programming 2 October 22nd 08 01:33 AM
Macro for copy and paste values excelnerd Excel Discussion (Misc queries) 3 March 8th 08 06:51 PM
How to write a simple copy-paste macro? R. H. Rosenberg New Users to Excel 4 November 25th 06 12:26 AM
Macro newbie - simple copy/paste function Nat Excel Programming 2 August 16th 06 05:37 PM


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