vba

maxmasher

Board Regular
Joined
Nov 21, 2010
Messages
81
i have a column of cells g4 to g25 and a button for which i would like the button to time stamp the next empty cell in the column

cheers
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Assuming that you always want to time stamp G26, you can assign this macro to the button:

Code:
Sub test()
    Range("G26") = Now()
End Sub

If the location of the last cell in column G will vary, then use:

Code:
Sub test()
    Dim bottomG As Integer
    bottomG = Range("G" & Rows.Count).End(xlUp).Row
    Range("G" & bottomG + 1) = Now()
End Sub
 
Upvote 0
works good, i have another button using this code but i only want to start from e45
thanks



Private Sub CommandButton1_Click()
Range("e" & Rows.Count).End(xlUp).Offset(1).Value = Time
End Sub
 
Upvote 0
Where in column E do you want the time stamp? Is it in a specific cell or at the bottom of column E?
 
Upvote 0
Try:

Code:
Sub test()
    Dim bottomE As Integer
    bottomE = Range("E" & Rows.Count).End(xlUp).Row
    Range("E" & bottomE + 1) = Now()
End Sub
 
Upvote 0
no good i dont need to go bottom thats the code you already gave me which is fine thanks but i need to start at cell e45 and then e46 etc
 
Upvote 0

Forum statistics

Threads
1,216,102
Messages
6,128,852
Members
449,471
Latest member
lachbee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top