ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro required (https://www.excelbanter.com/excel-worksheet-functions/59828-macro-required.html)

PCOR

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



Sandy Mann

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





PCOR

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







Sandy Mann

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










All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com