ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   selecting a range (https://www.excelbanter.com/excel-programming/272252-selecting-range.html)

David

selecting a range
 
I am trying to select a range in column B and then have
the information cut, and pasted into column A at the
bottom of the information in column A. How can this be
done simply?

Thanks,
David

John[_37_]

selecting a range
 
Try this, maybe not the best but it works

I asume you have the range selected:

Sub test()
Selection.Cut
Cells(Range("A65000").End(xlUp).Row + 1, 1).Paste
ActiveSheet.Paste
End Sub

Regards,

John

-----Original Message-----
I am trying to select a range in column B and then have
the information cut, and pasted into column A at the
bottom of the information in column A. How can this be
done simply?

Thanks,
David
.


JS[_4_]

selecting a range
 
try the following

Sub CopySelection()
If Selection.Rows.Count < Rows.Count - Range("B" &
Rows.Count).End(xlUp).Row Then
Selection.Copy
Range("B" & Rows.Count).End(xlUp).PasteSpecial
Else
MsgBox "Cannot paste selection - not enough rows"
End If
End Sub

very easy to change this to an addin to you can have it as a button on
toolbar for all spreadsheets - let me know if u need this.




All times are GMT +1. The time now is 10:03 PM.

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