Edit to existing code please

ipbr21054

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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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