Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Generate ongoing database of results via Macro

Hello,

I will be very grateful for your help on this problem! I am very new to
macros.

I have data on "Sheet1" in cells A2:P3. These cells reference other cells on
different tabs and the data changes day-to-day. So, I need a macro which
copies & pastes (values only) the data in cells A2:P3 onto a new sheet
("CashTransferRecord").

Here is the hard part ...

Each time I run the macro I would like the data to be pasted to the first
two blank rows below the existing rows which already have data in them.

Note: the first time the macro runs i would like the two rows of data it
pastes onto "CashTransferRecord" to be pasted in rows 2 and 3.



Can this be done?!

Many Thank

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Generate ongoing database of results via Macro

Sub cpy2rws()
lr = Worksheets("CashTransferRecord").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Range("$A$2:$P$3").Copy _
Worksheets("CashTransferRecord").Range("A" & lr + 1)
End Sub

"Brice" wrote:

Hello,

I will be very grateful for your help on this problem! I am very new to
macros.

I have data on "Sheet1" in cells A2:P3. These cells reference other cells on
different tabs and the data changes day-to-day. So, I need a macro which
copies & pastes (values only) the data in cells A2:P3 onto a new sheet
("CashTransferRecord").

Here is the hard part ...

Each time I run the macro I would like the data to be pasted to the first
two blank rows below the existing rows which already have data in them.

Note: the first time the macro runs i would like the two rows of data it
pastes onto "CashTransferRecord" to be pasted in rows 2 and 3.



Can this be done?!

Many Thank

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Generate ongoing database of results via Macro

Disregard the first one. It will copy everything over. This one only does
values.

Sub cpy2rws()
lr = Worksheets("CashTransferRecord").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Range("$A$2:$P$3").Copy
Worksheets("CashTransferRecord").Range("A" & lr + 1).PasteSpecial _
Paste:=xlValues
End Sub

"Brice" wrote:

Hello,

I will be very grateful for your help on this problem! I am very new to
macros.

I have data on "Sheet1" in cells A2:P3. These cells reference other cells on
different tabs and the data changes day-to-day. So, I need a macro which
copies & pastes (values only) the data in cells A2:P3 onto a new sheet
("CashTransferRecord").

Here is the hard part ...

Each time I run the macro I would like the data to be pasted to the first
two blank rows below the existing rows which already have data in them.

Note: the first time the macro runs i would like the two rows of data it
pastes onto "CashTransferRecord" to be pasted in rows 2 and 3.



Can this be done?!

Many Thank

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Generate ongoing database of results via Macro

Thanks for your help.

When I run the macro for the second time, the data is overwriting the
existing data in rows two and three. I would likle to have the macro ADD the
data/record to the next available rows so that I can keep an ongoign database.

Can you help?

"JLGWhiz" wrote:

Disregard the first one. It will copy everything over. This one only does
values.

Sub cpy2rws()
lr = Worksheets("CashTransferRecord").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Range("$A$2:$P$3").Copy
Worksheets("CashTransferRecord").Range("A" & lr + 1).PasteSpecial _
Paste:=xlValues
End Sub

"Brice" wrote:

Hello,

I will be very grateful for your help on this problem! I am very new to
macros.

I have data on "Sheet1" in cells A2:P3. These cells reference other cells on
different tabs and the data changes day-to-day. So, I need a macro which
copies & pastes (values only) the data in cells A2:P3 onto a new sheet
("CashTransferRecord").

Here is the hard part ...

Each time I run the macro I would like the data to be pasted to the first
two blank rows below the existing rows which already have data in them.

Note: the first time the macro runs i would like the two rows of data it
pastes onto "CashTransferRecord" to be pasted in rows 2 and 3.



Can this be done?!

Many Thank

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Generate ongoing database of results via Macro

Can someone help me with this MACRO problem?

"Brice" wrote:

Thanks for your help.

When I run the macro for the second time, the data is overwriting the
existing data in rows two and three. I would like to have the macro ADD the
data/record to the next available rows so that I can keep an ongoign database.

Can you help?

"JLGWhiz" wrote:

Disregard the first one. It will copy everything over. This one only does
values.

Sub cpy2rws()
lr = Worksheets("CashTransferRecord").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Range("$A$2:$P$3").Copy
Worksheets("CashTransferRecord").Range("A" & lr + 1).PasteSpecial _
Paste:=xlValues
End Sub

"Brice" wrote:

Hello,

I will be very grateful for your help on this problem! I am very new to
macros.

I have data on "Sheet1" in cells A2:P3. These cells reference other cells on
different tabs and the data changes day-to-day. So, I need a macro which
copies & pastes (values only) the data in cells A2:P3 onto a new sheet
("CashTransferRecord").

Here is the hard part ...

Each time I run the macro I would like the data to be pasted to the first
two blank rows below the existing rows which already have data in them.

Note: the first time the macro runs i would like the two rows of data it
pastes onto "CashTransferRecord" to be pasted in rows 2 and 3.



Can this be done?!

Many Thank



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Generate ongoing database of results via Macro

Hi Brice

Worksheets("Sheet1").Range("$A$2:$P$3").Copy
Worksheets("CashTransferRecord").Range("A65000").E nd(xlUp).Offset(2,
0).Cells.PasteSpecial (xlPasteValues)
Regards
JY

"Brice" wrote in message
...
Can someone help me with this MACRO problem?

"Brice" wrote:

Thanks for your help.

When I run the macro for the second time, the data is overwriting the
existing data in rows two and three. I would like to have the macro ADD
the
data/record to the next available rows so that I can keep an ongoign
database.

Can you help?

"JLGWhiz" wrote:

Disregard the first one. It will copy everything over. This one only
does
values.

Sub cpy2rws()
lr = Worksheets("CashTransferRecord").Cells(Rows.Count,
1).End(xlUp).Row
Worksheets("Sheet1").Range("$A$2:$P$3").Copy
Worksheets("CashTransferRecord").Range("A" & lr + 1).PasteSpecial _
Paste:=xlValues
End Sub

"Brice" wrote:

Hello,

I will be very grateful for your help on this problem! I am very new
to
macros.

I have data on "Sheet1" in cells A2:P3. These cells reference other
cells on
different tabs and the data changes day-to-day. So, I need a macro
which
copies & pastes (values only) the data in cells A2:P3 onto a new
sheet
("CashTransferRecord").

Here is the hard part ...

Each time I run the macro I would like the data to be pasted to the
first
two blank rows below the existing rows which already have data in
them.

Note: the first time the macro runs i would like the two rows of data
it
pastes onto "CashTransferRecord" to be pasted in rows 2 and 3.



Can this be done?!

Many Thank



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Generate ongoing database of results via Macro

Actually you'd have to do this because of your requirement to have the data
start on row 2 if you're just starting out. And the offset # was wrong, sb 1
not 2. HTH

Sub Doit()


Sheets("CashTransferRecord").Select
If Cells(2, 1).Value = Empty Then
Worksheets("Sheet1").Range("$A$2:$P$3").Copy
Worksheets("CashTransferRecord").Range("a2").Paste Special (xlPasteValues)
Else
Worksheets("Sheet1").Range("$A$2:$P$3").Copy
Worksheets("CashTransferRecord").Range("A65000").E nd(xlUp).Offset(1,
0).Cells.PasteSpecial (xlPasteValues)
End If
End Sub


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
Excel trend line equation does not generate correct results francis phillips Excel Discussion (Misc queries) 0 October 12th 11 01:05 AM
How to generate a worksheet out of an Excel 2003 database? Daptin Excel Worksheet Functions 5 November 25th 06 05:59 PM
How can I generate avery address labels from database Abdool Rahim New Users to Excel 2 October 27th 05 08:16 PM
Using For/Next Loop To Generate 4 CommandButtons On A UserForm Results In A Runtime Error 91 Donna[_7_] Excel Programming 4 February 28th 05 01:21 PM
How to generate a file copy of the Excel Find results list MrSpreadsheet Excel Programming 4 February 11th 05 07:07 AM


All times are GMT +1. The time now is 06:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"