#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PCOR
 
Posts: n/a
Default Macro required

Hi All
I would sure like to have a macro that will do the following:
1. Select B1
2. Run down the B col until it finds a blank
3. Then paste in that blank line (starting a col B )what has been placed in
the clipboard.
Would appreciate any help
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sandy Mann
 
Posts: n/a
Default Macro required

Assuming that the copy and paste are both in the same sheet and the data to
be copied when the Macro is invoked is highlighted then try:

Sub CopyIt()
Dim Here As Long

'Set Here to last Row +1 for no blank cells
Here = Cells(Rows.Count, 2).End(xlUp).Row + 1

On Error Resume Next '(If no blank cells)
Here = Columns("B").SpecialCells(xlCellTypeBlanks).Row

Selection.Copy Destination:=Cells(Here, 2)

Application.CutCopyMode = False

End Sub

--
HTH

Sandy

Replace@mailinator with @tiscali.co.uk


"PCOR" wrote in message
.. .
Hi All
I would sure like to have a macro that will do the following:
1. Select B1
2. Run down the B col until it finds a blank
3. Then paste in that blank line (starting a col B )what has been placed
in the clipboard.
Would appreciate any help
Thanks




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PCOR
 
Posts: n/a
Default Macro required

Thanks forthe help but.....
What I really need is:
I want a macro that will run down Col B ,find the first blank row and paste
what ever is in the clipboard.
Any help appreciated.\
"Sandy Mann" wrote in message
...
Assuming that the copy and paste are both in the same sheet and the data
to
be copied when the Macro is invoked is highlighted then try:

Sub CopyIt()
Dim Here As Long

'Set Here to last Row +1 for no blank cells
Here = Cells(Rows.Count, 2).End(xlUp).Row + 1

On Error Resume Next '(If no blank cells)
Here = Columns("B").SpecialCells(xlCellTypeBlanks).Row

Selection.Copy Destination:=Cells(Here, 2)

Application.CutCopyMode = False

End Sub

--
HTH

Sandy

Replace@mailinator with @tiscali.co.uk


"PCOR" wrote in message
.. .
Hi All
I would sure like to have a macro that will do the following:
1. Select B1
2. Run down the B col until it finds a blank
3. Then paste in that blank line (starting a col B )what has been placed
in the clipboard.
Would appreciate any help
Thanks






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sandy Mann
 
Posts: n/a
Default Macro required

"PCOR" wrote in message
...
Thanks forthe help but.....
What I really need is:
I want a macro that will run down Col B ,find the first blank row and
paste what ever is in the clipboard.


Is that not what my Macro does with the exception of the fact that you have
to high-light the data so that it will be loaded into the clipboard?

How are you loading the data into the clipboard in the first place?

If you want to copy data from other sheets and have it pasted into one
particular sheet, say sheet1 save it to the clipboard and then run this
Macro:

Sub CopyItClipboard()
Dim Here As Long

Application.ScreenUpdating = False

With Sheets("Sheet1")
'Set Here to last Row +1
Here = .Cells(.Rows.Count, 2).End(xlUp).Row + 1

On Error Resume Next '(If no blank cells)
Here = .Columns("B").SpecialCells(xlCellTypeBlanks).Row

.Paste Destination:=.Cells(Here, 2)
End With

Application.ScreenUpdating = True
Application.CutCopyMode = False

End Sub

Replace "Sheet1" with the name of the sheet you want.

--
HTH

Sandy

Replace@mailinator with @tiscali.co.uk


"PCOR" wrote in message
...
Thanks forthe help but.....
What I really need is:
I want a macro that will run down Col B ,find the first blank row and
paste what ever is in the clipboard.
Any help appreciated.\
"Sandy Mann" wrote in message
...
Assuming that the copy and paste are both in the same sheet and the data
to
be copied when the Macro is invoked is highlighted then try:

Sub CopyIt()
Dim Here As Long

'Set Here to last Row +1 for no blank cells
Here = Cells(Rows.Count, 2).End(xlUp).Row + 1

On Error Resume Next '(If no blank cells)
Here = Columns("B").SpecialCells(xlCellTypeBlanks).Row

Selection.Copy Destination:=Cells(Here, 2)

Application.CutCopyMode = False

End Sub

--
HTH

Sandy

Replace@mailinator with @tiscali.co.uk


"PCOR" wrote in message
.. .
Hi All
I would sure like to have a macro that will do the following:
1. Select B1
2. Run down the B col until it finds a blank
3. Then paste in that blank line (starting a col B )what has been placed
in the clipboard.
Would appreciate any help
Thanks








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
Macro Help required Paul Sheppard Excel Discussion (Misc queries) 2 December 8th 05 10:30 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
vba macro required ? Peter O'Leary Links and Linking in Excel 1 April 14th 05 11:49 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM


All times are GMT +1. The time now is 05:15 PM.

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"