A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro - Copy/Paste Special to Next Blank Line



 
 
Thread Tools Display Modes
  #1  
Old February 11th, 2009, 03:24 PM posted to microsoft.public.excel.newusers
lajohn63[_2_]
external usenet poster
 
Posts: 1
Default Macro - Copy/Paste Special to Next Blank Line


I have a macro that I'm using to copy and paste special into another
spreadsheet...the problem I am having is that it will not select the
next blank line in the spreadsheet, it overlays what I already have. I
need to have it keep adding to the existing data and I'm not sure how to
do it. I'm sure it is something simple but I'm new to all of this!

Here is my existing code:
Sub Load_Data()
'
' Keyboard Shortcut: Ctrl+z
'
Workbooks.Open Filename:="F:\SSCW\Load File.xls", UpdateLinks:=0
Windows("TEST- XXXXXX.xls").Activate
Sheets("Sheet1").Select
Range("A2:H2").Select
Selection.Copy
Windows("Load File.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub




--
lajohn63
  #2  
Old February 11th, 2009, 08:45 PM posted to microsoft.public.excel.newusers
Ron de Bruin
external usenet poster
 
Posts: 2,861
Default Macro - Copy/Paste Special to Next Blank Line

Hi lajohn63

See the example on this page
http://www.rondebruin.nl/copy1.htm

Try this example
What if the Database sheet is in another workbook





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"lajohn63" wrote in message ...

I have a macro that I'm using to copy and paste special into another
spreadsheet...the problem I am having is that it will not select the
next blank line in the spreadsheet, it overlays what I already have. I
need to have it keep adding to the existing data and I'm not sure how to
do it. I'm sure it is something simple but I'm new to all of this!

Here is my existing code:
Sub Load_Data()
'
' Keyboard Shortcut: Ctrl+z
'
Workbooks.Open Filename:="F:\SSCW\Load File.xls", UpdateLinks:=0
Windows("TEST- XXXXXX.xls").Activate
Sheets("Sheet1").Select
Range("A2:H2").Select
Selection.Copy
Windows("Load File.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub




--
lajohn63

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.