Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda