Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Macro to Paste at next blank row

This Macro copies from 1 tab to another tab in a workbook. The tab that the
data is being pasted into, keeps pasting to the same row. I want the data
pasted to the next empty row.
-----------------------------------------------
Sub copydata()
'
' copydata Macro
'
' Keyboard Shortcut: Ctrl+t
'
Application.Goto Reference:="R7C1"
Rows("7:7").Select
Selection.Copy
ActiveSheet.Next.Select
Application.Run "BLPLinkReset"
Application.Goto Reference:="R8C1"
Selection.End(xlDown).Select
Range("A11").Select <----- how do I change this to = next
blank row?
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Drop").Select
Application.Run "BLPLinkReset"
Application.CutCopyMode = False
Application.Goto Reference:="R1C1"
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Macro to Paste at next blank row

Try this replace "B5" with the cell you want to start with

Range("b5").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Macro to Paste at next blank row

On Sep 17, 10:16 pm, Lightjag
wrote:
This Macro copies from 1 tab to another tab in a workbook. The tab that the
data is being pasted into, keeps pasting to the same row. I want the data
pasted to the next empty row.
-----------------------------------------------
Sub copydata()
'
' copydata Macro
'
' Keyboard Shortcut: Ctrl+t
'
Application.Goto Reference:="R7C1"
Rows("7:7").Select
Selection.Copy
ActiveSheet.Next.Select
Application.Run "BLPLinkReset"
Application.Goto Reference:="R8C1"
Selection.End(xlDown).Select
Range("A11").Select <----- how do I change this to = next
blank row?
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Drop").Select
Application.Run "BLPLinkReset"
Application.CutCopyMode = False
Application.Goto Reference:="R1C1"
End Sub


I am quite sure someones going to find a better solution, but this one
should work:
Replace range("A11").select with:
Range("A65536").End(xlUp).Select ' If you use Excel 2007 you should
replace A65536 with 1048576
r = Selection.Row + 1
Range("A" & r).Select

Per Erik

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro to Paste at next blank row

Hi Lightjag

See also
http://www.rondebruin.nl/copy1.htm

--

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


"Lightjag" wrote in message ...
This Macro copies from 1 tab to another tab in a workbook. The tab that the
data is being pasted into, keeps pasting to the same row. I want the data
pasted to the next empty row.
-----------------------------------------------
Sub copydata()
'
' copydata Macro
'
' Keyboard Shortcut: Ctrl+t
'
Application.Goto Reference:="R7C1"
Rows("7:7").Select
Selection.Copy
ActiveSheet.Next.Select
Application.Run "BLPLinkReset"
Application.Goto Reference:="R8C1"
Selection.End(xlDown).Select
Range("A11").Select <----- how do I change this to = next
blank row?
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Drop").Select
Application.Run "BLPLinkReset"
Application.CutCopyMode = False
Application.Goto Reference:="R1C1"
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 macro to check if cell is not blank & previous cell is blank, copy information from row above & paste JenIT Excel Programming 4 April 12th 07 08:56 PM
Macro - Issue with cut and paste if a column is blank Dileep Chandran Excel Programming 0 January 18th 07 06:05 AM
Macro copy and paste = blank worksheet efface Excel Discussion (Misc queries) 1 April 27th 06 09:52 PM
Using a Macro to paste into Blank Cells phillipsb Excel Worksheet Functions 0 October 5th 05 05:58 PM
Macro to paste data into next blank row Cynthia[_3_] Excel Programming 1 February 7th 04 10:11 PM


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