View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mikus Mikus is offline
external usenet poster
 
Posts: 33
Default 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