ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Until Blank (https://www.excelbanter.com/excel-programming/280032-copy-until-blank.html)

Alec

Copy Until Blank
 
I have a sheet where the number of rows may vary in a
range, I need to copy this range to another sheet. But I
cannot find any function that will give me the first empty
row in a range, or empty cell in a column.

Any help would be appreciated.

Thanks
Alec

Mike Fogleman

Copy Until Blank
 
Activesheet.UsedRange.Copy

Mike
"Alec" wrote in message
...
I have a sheet where the number of rows may vary in a
range, I need to copy this range to another sheet. But I
cannot find any function that will give me the first empty
row in a range, or empty cell in a column.

Any help would be appreciated.

Thanks
Alec




Alec

Copy Until Blank
 
Thanks for your reply Mike:

However I do not want to copy the whole used range, but a
number columns within that range.


-----Original Message-----
Activesheet.UsedRange.Copy

Mike
"Alec" wrote in

message
...
I have a sheet where the number of rows may vary in a
range, I need to copy this range to another sheet. But I
cannot find any function that will give me the first

empty
row in a range, or empty cell in a column.

Any help would be appreciated.

Thanks
Alec



.


Don Guillett[_4_]

Copy Until Blank
 

Does this help?

x=cells(65536,"a").end(xldown).row
y=cells(1,"IV").end(xltoright).column

"Alec" wrote in message
...
I have a sheet where the number of rows may vary in a
range, I need to copy this range to another sheet. But I
cannot find any function that will give me the first empty
row in a range, or empty cell in a column.

Any help would be appreciated.

Thanks
Alec




Alec

Copy Until Blank
 
Thanks Don;

The End statement works fine.




-----Original Message-----

Does this help?

x=cells(65536,"a").end(xldown).row
y=cells(1,"IV").end(xltoright).column

"Alec" wrote in

message
...
I have a sheet where the number of rows may vary in a
range, I need to copy this range to another sheet. But I
cannot find any function that will give me the first

empty
row in a range, or empty cell in a column.

Any help would be appreciated.

Thanks
Alec



.


Don Guillett[_4_]

Copy Until Blank
 
Actually, the y one is incorrect
y=cells(1,"IV").end(xltoright).column
y=cells(1,"IV").end(xltoLEFT).column

OR
y=cells(1,1).end(xltoright).column


"Alec" wrote in message
...
Thanks Don;

The End statement works fine.




-----Original Message-----

Does this help?

x=cells(65536,"a").end(xldown).row
y=cells(1,"IV").end(xltoright).column

"Alec" wrote in

message
...
I have a sheet where the number of rows may vary in a
range, I need to copy this range to another sheet. But I
cannot find any function that will give me the first

empty
row in a range, or empty cell in a column.

Any help would be appreciated.

Thanks
Alec



.





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

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