Edit to existing code please

ipbr21054

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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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!
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,429
Members
448,961
Latest member
nzskater

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
Back
Top