ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with selecting a range of cells (https://www.excelbanter.com/excel-programming/320588-re-help-selecting-range-cells.html)

Mick[_3_]

Help with selecting a range of cells
 
Thank you all for the suggestions, it no longer ceases to amaze me how may
different ways there are to do the same thing. Your help is very much
appreciated.

Regards
Mick

"Mick" wrote in message
...
This is just a small part of my macro, I do hope the eagle eyed amongst
you can spot my mistake, all I want to do is select a range of cells in a
row and copy them?

I don't want to specify the range of cells by naming the rows/columns as I
need to use the code elsewhere in my macro i.e ("B5:J5")

Sub CopyRowAndAddAsNewRow()
Dim StartCell As String
Dim EndCell As String
Range("A1").Select
ActiveCell.Offset(4, 1).Select
StartCell = ActiveCell
EndCell = ActiveCell.Offset(0, 8)
Range("StartCell:EndCell").Select
Selection.Copy
End Sub

--
Kind Regards

Mick





All times are GMT +1. The time now is 09:23 PM.

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