Edit to existing code please

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
4,247
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
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

tyija1995

Well-known Member
Joined
Feb 26, 2019
Messages
781
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
4,247
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,598
Messages
5,832,646
Members
430,151
Latest member
Kacbear

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top