![]() |
A COPY macro
Hi
I have data in col a/b/c/d/e/f/g/h and I I would like to have a macro that will copy this data: the catch: the bottom row varies from week to week. Some times it is row 25 and the following week it could be row 40. I want to copy that data to an other sheet Help would be appreciated. |
A COPY macro
Did the answers from yesterday not work for you?
http://tinyurl.com/78tug Regards Rowan "PCOR" wrote: Hi I have data in col a/b/c/d/e/f/g/h and I I would like to have a macro that will copy this data: the catch: the bottom row varies from week to week. Some times it is row 25 and the following week it could be row 40. I want to copy that data to an other sheet Help would be appreciated. |
A COPY macro
This code copeis from sheet 1 and appends to sheet 2...
Sub CopyStuff() Dim wksFrom As Worksheet Dim wksTo As Worksheet Dim rngFrom As Range Dim rngTo As Range Set wksFrom = Sheets("Sheet1") Set wksTo = Sheets("Sheet2") Set rngFrom = wksFrom.Range(wksFrom.Cells(Rows.Count, "A").End(xlUp), _ wksFrom.Range("I1")) Set rngTo = wksTo.Cells(Rows.Count, "A").End(xlUp) rngFrom.Copy rngTo End Sub -- HTH... Jim Thomlinson "PCOR" wrote: Hi I have data in col a/b/c/d/e/f/g/h and I I would like to have a macro that will copy this data: the catch: the bottom row varies from week to week. Some times it is row 25 and the following week it could be row 40. I want to copy that data to an other sheet Help would be appreciated. |
A COPY macro
opps... use this...
Sub CopyStuff() Dim wksFrom As Worksheet Dim wksTo As Worksheet Dim rngFrom As Range Dim rngTo As Range Set wksFrom = Sheets("Sheet1") Set wksTo = Sheets("Sheet2") Set rngFrom = wksFrom.Range(wksFrom.Cells(Rows.Count, "A").End(xlUp), _ wksFrom.Range("I1")) Set rngTo = wksTo.Cells(Rows.Count, "A").End(xlUp).offset(1,0) rngFrom.Copy rngTo End Sub -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: This code copeis from sheet 1 and appends to sheet 2... Sub CopyStuff() Dim wksFrom As Worksheet Dim wksTo As Worksheet Dim rngFrom As Range Dim rngTo As Range Set wksFrom = Sheets("Sheet1") Set wksTo = Sheets("Sheet2") Set rngFrom = wksFrom.Range(wksFrom.Cells(Rows.Count, "A").End(xlUp), _ wksFrom.Range("I1")) Set rngTo = wksTo.Cells(Rows.Count, "A").End(xlUp) rngFrom.Copy rngTo End Sub -- HTH... Jim Thomlinson "PCOR" wrote: Hi I have data in col a/b/c/d/e/f/g/h and I I would like to have a macro that will copy this data: the catch: the bottom row varies from week to week. Some times it is row 25 and the following week it could be row 40. I want to copy that data to an other sheet Help would be appreciated. |
A COPY macro
Yes it did work very well......My fault because I just found your reply
AFTER I had posted the second query. Most sincere thanks "Rowan" <rowanzsa at hotmailNOSPAM dot com wrote in message ... Did the answers from yesterday not work for you? http://tinyurl.com/78tug Regards Rowan "PCOR" wrote: Hi I have data in col a/b/c/d/e/f/g/h and I I would like to have a macro that will copy this data: the catch: the bottom row varies from week to week. Some times it is row 25 and the following week it could be row 40. I want to copy that data to an other sheet Help would be appreciated. |
A COPY macro
I thank you VERY much.
Rowan's suggestion worked very well....but your worked even better....because your APPENDS (I did not ask for that but it sure fit my requirement)Many thanks "Jim Thomlinson" wrote in message ... opps... use this... Sub CopyStuff() Dim wksFrom As Worksheet Dim wksTo As Worksheet Dim rngFrom As Range Dim rngTo As Range Set wksFrom = Sheets("Sheet1") Set wksTo = Sheets("Sheet2") Set rngFrom = wksFrom.Range(wksFrom.Cells(Rows.Count, "A").End(xlUp), _ wksFrom.Range("I1")) Set rngTo = wksTo.Cells(Rows.Count, "A").End(xlUp).offset(1,0) rngFrom.Copy rngTo End Sub -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: This code copeis from sheet 1 and appends to sheet 2... Sub CopyStuff() Dim wksFrom As Worksheet Dim wksTo As Worksheet Dim rngFrom As Range Dim rngTo As Range Set wksFrom = Sheets("Sheet1") Set wksTo = Sheets("Sheet2") Set rngFrom = wksFrom.Range(wksFrom.Cells(Rows.Count, "A").End(xlUp), _ wksFrom.Range("I1")) Set rngTo = wksTo.Cells(Rows.Count, "A").End(xlUp) rngFrom.Copy rngTo End Sub -- HTH... Jim Thomlinson "PCOR" wrote: Hi I have data in col a/b/c/d/e/f/g/h and I I would like to have a macro that will copy this data: the catch: the bottom row varies from week to week. Some times it is row 25 and the following week it could be row 40. I want to copy that data to an other sheet Help would be appreciated. |
All times are GMT +1. The time now is 09:57 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com