Forum Discussion
bvelke
May 30, 2019Copper Contributor
Button to jump and autofill?
Is it possible to create a button at A1 that will (1) jump to the first blank cell in that column and (2) fill that cell with today's date (as a value, not a function)? As my first attempt, I cre...
- Jun 01, 2019
The solution is to make the starting cell in the macro always the first left-most cell in the table which is A5.
Which require changing the code a little bit as follows:
Sub JumpToTheFirstBlankCell()
Range("A5").End(xlDown).Offset(1, 0).Select
Selection.Value = Date
End SubHope that helps
bvelke
Jun 01, 2019Copper Contributor
Haytham Amairah Actually, I wanted it to fill in the date using your code and then move one column to the right. So I added this at the end of your code:
ActiveCell.Offset(0, 1).Range("A1").Select
I confess that I cheated. I recorded a macro and then looked at the code that it generated. :-) But now I have exactly what I wanted!
Thanks again for all of your help.
Haytham Amairah
Jun 01, 2019Silver Contributor
You're welcome.
By the way, this is common practice, I also do it sometimes.
I confess that I cheated. I recorded a macro and then looked at the code that it generated.