Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
VBA how to find the last empty cell after an active 1

I want to fill in the time in the next empty cell , but the fucntion End(xlUp) takes me to the last active cell , and the End(xlDown) takes me to the last cell of the chart.

What do I do? Please help me

Here's the code I wrote to find the last cell of column "F" .

Function insertTime()

Range("F").End (xlUp)  = Now()

End Function

example image

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

If your sheet is empty then it will take to last row. If you have data in F Column then it will take to the last cell. Try below codes

Sub insertTime()
    Cells(Rows.Count, "F").End(xlUp).Offset(1, 0) = Now()
End Sub
about 4 years ago · Santiago Trujillo Report

0

Offset() to the rescue: where-ever you are, you can use Offset() to move one cell to the left (Offset(0,-1)), to the right (Offset(0,1)), up (Offset(-1,0)) or down (Offset(1,0)), and obviously you can use other numbers: Offset(1,2), Offset(2,-1), ... are ways to jump around like a horse on a chessboard :-)

For your application, I believe that this (or a similar one) might help you:

Go up and to the right:

Range("F:F").End (xlUp).Offset(0,1)  = Now()

Go down and one deeper:

Range("F1").End (xlDown).Offset(1,0)  = Now()

...

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!