Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have need a macro that will select a range in a column and copy
data. In one spreadsheet the column range maybe N2 - N15 the next time the column range maybe N2 - N250 How can I code it to select N2 - last cell in column so I don't have to change macro each time for each spreadsheet. Thank you Terrie |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Try this lastrow = Cells(Rows.Count, "N").End(xlUp).Row Range("N2:N" & lastrow).Select Mike " wrote: I have need a macro that will select a range in a column and copy data. In one spreadsheet the column range maybe N2 - N15 the next time the column range maybe N2 - N250 How can I code it to select N2 - last cell in column so I don't have to change macro each time for each spreadsheet. Thank you Terrie |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about a nice one liner broken up to account for possible word wrap. NO
selections Sub copyrng() Cells(2, 4).Resize(Cells(Rows.Count, 4). _ End(xlUp).Row - 1).Copy range("z5") End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... I have need a macro that will select a range in a column and copy data. In one spreadsheet the column range maybe N2 - N15 the next time the column range maybe N2 - N250 How can I code it to select N2 - last cell in column so I don't have to change macro each time for each spreadsheet. Thank you Terrie |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On May 28, 2:41*pm, "Don Guillett" wrote:
How about a nice one liner broken up to account for possible word wrap. NO selections Sub copyrng() Cells(2, 4).Resize(Cells(Rows.Count, 4). _ * End(xlUp).Row - 1).Copy range("z5") End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software wrote in message ... I have need a macro that will select a range *in a column and copy data. In one spreadsheet the column range maybe N2 - N15 the next time the column range maybe N2 - N250 How can I code it to select N2 - last cell in column so I don't have to change macro each time for each spreadsheet. Thank you Terrie- Hide quoted text - - Show quoted text - Thank you all for your help. Your information pointed me in the direction to accomplish my selection. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting ICONS for Macros in Excel 2007 | New Users to Excel | |||
Selecting ranges in macros | Excel Programming | |||
how do I use formulas with changing ranges in excel with macros | Excel Discussion (Misc queries) | |||
Can Excel Macros and Ranges be streamed ? | Excel Programming | |||
selecting ranges | Excel Programming |