How to get pointer in new cell on Open?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to have the pointer in the next new cell each time I open the
workbook. is there a way to do this?
Thanks
 
Hi Jazz

You can do this for example in the workbook open event (user must enabled macro's)
to insert the date in a cell every time you open it on a new line in "Sheet2"

Private Sub Workbook_Open()
Dim lr As Long
With Sheets("sheet2")
lr = .Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row
.Cells(lr, "A").Value = Date
.Cells(lr, "B").Value = Environ$("username")
End With
End Sub

See also
http://www.cpearson.com/excel/events.htm
 
Ron,
Thanks for the info!

Ron de Bruin said:
Hi Jazz

You can do this for example in the workbook open event (user must enabled macro's)
to insert the date in a cell every time you open it on a new line in "Sheet2"

Private Sub Workbook_Open()
Dim lr As Long
With Sheets("sheet2")
lr = .Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row
.Cells(lr, "A").Value = Date
.Cells(lr, "B").Value = Environ$("username")
End With
End Sub

See also
http://www.cpearson.com/excel/events.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top