#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 72
Default Macro Help

i have a macro that copies data from another sheet, the problem i have is
when ever i use the macro it puts the data into the same place every time
What i would like is the macro to start from the next available blank cell
in cloumn A

My Simple macro looks like below
Is there some code i need to add to the front


Sub Macro2()
'
' Macro2 Macro
'

'
Sheets("Pilot Valve Material").Select
Range("A2:H50").Select
Selection.Copy
Sheets("Stock Transactions").Select
Range("A1597").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=48
Range("A1645").Select
Application.CutCopyMode = False
Application.Run "'Test Macro - Stock Transactions.xlsm'!Macro2"
ActiveWindow.SmallScroll Down:=-42
Range("A1597").Select
Application.Goto Reference:="Macro2"
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro Help

Shane,

These couple of lines do all the copying and pasting into the first empty
row of the sheet

lastrow = Sheets("Stock Transactions").Cells(Cells.Rows.Count,
"A").End(xlUp).Row
Sheets("Pilot Valve Material").Range("A2:H50").Copy _
Destination:=Sheets("Stock Transactions").Range("A" & lastrow + 1)

Miike

"Shane" wrote:

i have a macro that copies data from another sheet, the problem i have is
when ever i use the macro it puts the data into the same place every time
What i would like is the macro to start from the next available blank cell
in cloumn A

My Simple macro looks like below
Is there some code i need to add to the front


Sub Macro2()
'
' Macro2 Macro
'

'
Sheets("Pilot Valve Material").Select
Range("A2:H50").Select
Selection.Copy
Sheets("Stock Transactions").Select
Range("A1597").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=48
Range("A1645").Select
Application.CutCopyMode = False
Application.Run "'Test Macro - Stock Transactions.xlsm'!Macro2"
ActiveWindow.SmallScroll Down:=-42
Range("A1597").Select
Application.Goto Reference:="Macro2"
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 72
Default Macro Help

Mike thank you for the reply

I know I'm being thick but where do i add the data

If i was to completly delete what was in the macro how should it end up
looking

Shane

"Mike H" wrote:

Shane,

These couple of lines do all the copying and pasting into the first empty
row of the sheet

lastrow = Sheets("Stock Transactions").Cells(Cells.Rows.Count,
"A").End(xlUp).Row
Sheets("Pilot Valve Material").Range("A2:H50").Copy _
Destination:=Sheets("Stock Transactions").Range("A" & lastrow + 1)

Miike

"Shane" wrote:

i have a macro that copies data from another sheet, the problem i have is
when ever i use the macro it puts the data into the same place every time
What i would like is the macro to start from the next available blank cell
in cloumn A

My Simple macro looks like below
Is there some code i need to add to the front


Sub Macro2()
'
' Macro2 Macro
'

'
Sheets("Pilot Valve Material").Select
Range("A2:H50").Select
Selection.Copy
Sheets("Stock Transactions").Select
Range("A1597").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=48
Range("A1645").Select
Application.CutCopyMode = False
Application.Run "'Test Macro - Stock Transactions.xlsm'!Macro2"
ActiveWindow.SmallScroll Down:=-42
Range("A1597").Select
Application.Goto Reference:="Macro2"
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
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


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