ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find Empty Cell (https://www.excelbanter.com/excel-programming/283293-find-empty-cell.html)

Wally Steadman[_3_]

Find Empty Cell
 
I have a work sheet where I am copying multiple worksheets
to, I would like to programatically do this, but unsure of
how to have it look down Column A until it gets to the
first Empty Cell and then paste. Was looking at the
IsEmpty function but not sure that applies. I also would
like to know how I can get the first empty cell in a
column. A bit lost on this and I am sure it is very
simple. something like Sheets("Sheet1").Cells(isempty)

That is my wild guess. Any help would be appreciated.

Wally Steadman

Tom Ogilvy

Find Empty Cell
 
set rng = worksheets("Sheet1").cells(rows.count,1).End(xlup)

finds the last filled cell, so you can offset by 1

copy something Destination:=rng.offset(1,0)

--
Regards,
Tom Ogilvy

"Wally Steadman" wrote in message
...
I have a work sheet where I am copying multiple worksheets
to, I would like to programatically do this, but unsure of
how to have it look down Column A until it gets to the
first Empty Cell and then paste. Was looking at the
IsEmpty function but not sure that applies. I also would
like to know how I can get the first empty cell in a
column. A bit lost on this and I am sure it is very
simple. something like Sheets("Sheet1").Cells(isempty)

That is my wild guess. Any help would be appreciated.

Wally Steadman




Wally Steadman[_3_]

Find Empty Cell
 
Tom,
When I put the following code -- set rng = worksheets
("Sheet1").cells(rows.count,1).End(xlup)
and let it run with a break in it so I could see values,
the rows.count value was 65536 and I guess I was confused
as to the last destination line you added. Could you
possibly show an example using the following:

Sheet 1 has the following:

Column A only

1 A
2 B
3 C


Sheet2 as the following:

Column A only

1 Red
2 Green
3 Blue

So after running the code, it would copy the cells from
Column A and paste them below the 3 Blue in sheet2, so it
would look like:

1 Red
2 Green
3 Blue
4 A
5 B
6 C

I hope I was clear enough and really appreciate all the
help you have given over the past few days. I am serving
in Iraq and trying to work some tracking stuff that takes
hours right now and get it down to a few minute process
and with all the list help I am getting there slowly but
surely. So thanks again

Wally Steadman




-----Original Message-----
set rng = worksheets("Sheet1").cells(rows.count,1).End

(xlup)

finds the last filled cell, so you can offset by 1

copy something Destination:=rng.offset(1,0)

--
Regards,
Tom Ogilvy

"Wally Steadman"

wrote in message
...
I have a work sheet where I am copying multiple

worksheets
to, I would like to programatically do this, but unsure

of
how to have it look down Column A until it gets to the
first Empty Cell and then paste. Was looking at the
IsEmpty function but not sure that applies. I also

would
like to know how I can get the first empty cell in a
column. A bit lost on this and I am sure it is very
simple. something like Sheets("Sheet1").Cells(isempty)

That is my wild guess. Any help would be appreciated.

Wally Steadman



.


Tom Ogilvy

Find Empty Cell
 
Dim rng as Range
With Worksheets("sheet1")
set rng = .Range(.Cells(1,1),.Cells(rows.count,1).end(xlup))
End with

with Worksheets("Sheet2")
rng.copy Destination:= _
.cells(rows.count,1).End(xlup).Offset(1,0)
End With

--
Regards,
Tom Ogilvy

Wally Steadman wrote in message
...
Tom,
When I put the following code -- set rng = worksheets
("Sheet1").cells(rows.count,1).End(xlup)
and let it run with a break in it so I could see values,
the rows.count value was 65536 and I guess I was confused
as to the last destination line you added. Could you
possibly show an example using the following:

Sheet 1 has the following:

Column A only

1 A
2 B
3 C


Sheet2 as the following:

Column A only

1 Red
2 Green
3 Blue

So after running the code, it would copy the cells from
Column A and paste them below the 3 Blue in sheet2, so it
would look like:

1 Red
2 Green
3 Blue
4 A
5 B
6 C

I hope I was clear enough and really appreciate all the
help you have given over the past few days. I am serving
in Iraq and trying to work some tracking stuff that takes
hours right now and get it down to a few minute process
and with all the list help I am getting there slowly but
surely. So thanks again

Wally Steadman




-----Original Message-----
set rng = worksheets("Sheet1").cells(rows.count,1).End

(xlup)

finds the last filled cell, so you can offset by 1

copy something Destination:=rng.offset(1,0)

--
Regards,
Tom Ogilvy

"Wally Steadman"

wrote in message
...
I have a work sheet where I am copying multiple

worksheets
to, I would like to programatically do this, but unsure

of
how to have it look down Column A until it gets to the
first Empty Cell and then paste. Was looking at the
IsEmpty function but not sure that applies. I also

would
like to know how I can get the first empty cell in a
column. A bit lost on this and I am sure it is very
simple. something like Sheets("Sheet1").Cells(isempty)

That is my wild guess. Any help would be appreciated.

Wally Steadman



.





All times are GMT +1. The time now is 07:18 AM.

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