ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find emty cell in column and insert value (https://www.excelbanter.com/excel-programming/337507-find-emty-cell-column-insert-value.html)

Mikus

Find emty cell in column and insert value
 
I need macro that would find 1st empty cell in a range and then enter value
(current time) in it.

For example

I have following sheet

A B C D
1 10:15
2 11:20
3 13:50
4 14:32
5

I need macro that would examine column d and find out that 1st empty cell is
D5, then this macro should enter current time in D5!

This would enter time in currently selected cell ... how do i modify this
code for my purpose ?

Public Sub InsertTime()
With ActiveCell
.Value = Time
End With
End Sub



Mike Fogleman

Find emty cell in column and insert value
 
Hi Mikus,

Public Sub InsertTime()

Dim iLastRow As Long
iLastRow = Cells(Rows.Count, "D").End(xlUp).Row
Range("D"& iLastRow + 1).Value = Time
End Sub

Mike F
"Mikus" wrote in message
...
I need macro that would find 1st empty cell in a range and then enter value
(current time) in it.

For example

I have following sheet

A B C D
1 10:15
2 11:20
3 13:50
4 14:32
5

I need macro that would examine column d and find out that 1st empty cell
is
D5, then this macro should enter current time in D5!

This would enter time in currently selected cell ... how do i modify this
code for my purpose ?

Public Sub InsertTime()
With ActiveCell
.Value = Time
End With
End Sub





Eric White[_2_]

Find emty cell in column and insert value
 
Range("D65536").End(xlUp).Offset(1, 0).Value = Now

"Mikus" wrote:

I need macro that would find 1st empty cell in a range and then enter value
(current time) in it.

For example

I have following sheet

A B C D
1 10:15
2 11:20
3 13:50
4 14:32
5

I need macro that would examine column d and find out that 1st empty cell is
D5, then this macro should enter current time in D5!

This would enter time in currently selected cell ... how do i modify this
code for my purpose ?

Public Sub InsertTime()
With ActiveCell
.Value = Time
End With
End Sub



Mikus

Find emty cell in column and insert value
 
Thank's, your'e saving me again Mike!

"Mike Fogleman" wrote:

Hi Mikus,

Public Sub InsertTime()

Dim iLastRow As Long
iLastRow = Cells(Rows.Count, "D").End(xlUp).Row
Range("D"& iLastRow + 1).Value = Time
End Sub

Mike F
"Mikus" wrote in message
...
I need macro that would find 1st empty cell in a range and then enter value
(current time) in it.

For example

I have following sheet

A B C D
1 10:15
2 11:20
3 13:50
4 14:32
5

I need macro that would examine column d and find out that 1st empty cell
is
D5, then this macro should enter current time in D5!

This would enter time in currently selected cell ... how do i modify this
code for my purpose ?

Public Sub InsertTime()
With ActiveCell
.Value = Time
End With
End Sub







All times are GMT +1. The time now is 11:13 PM.

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