Edit to existing code please

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
3,635
Office Version
  1. 2007
Platform
  1. Windows
Hi,
Basically when i open a specific worksheet i need two things to happen.
1,Select cell A4
2,Open Userform.

I can only do one of them using the Private Sub Worksheet_Activate()

I have this in use on another sheet which does the two actions BUT its written to select the bottom on my sheet where i now need the top selected
Can this be edited to achieve that please ?

Thanks


Code:
Private Sub Worksheet_Activate()Application.GoTo Sheets("SKP IMMO LIST").Range("A" & Rows.Count).End(xlUp).Offset(1, 0), True
ActiveWindow.SmallScroll UP:=10


SKPForm.Show
End Sub
 

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

tyija1995

Well-known Member
Joined
Feb 26, 2019
Messages
766
Office Version
  1. 365
Platform
  1. Windows
Hi ipbr,

You could add Range("A4").Select to the code like so:
Code:
Private Sub Worksheet_Activate()Application.GoTo Sheets("SKP IMMO LIST").Range("A" & Rows.Count).End(xlUp).Offset(1, 0), True
ActiveWindow.SmallScroll UP:=10


SKPForm.Show
Range("A4").Select
End Sub

Let me know if it works!
 

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
3,635
Office Version
  1. 2007
Platform
  1. Windows
Thanks.
Didn’t think it was going to be that easy.
In the end I just select cell A4 then show form.
Deleted other part of the code.

Thanks.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,632
Messages
5,523,994
Members
409,554
Latest member
denistrevisan

This Week's Hot Topics

Top