One cell incorporating offset in existing sub

Status
Not open for further replies.

handric

New Member
Joined
Feb 17, 2023
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I need to incorporate this one offset in code bellow. It is marked bold.
The issue is after the page on worksheet is done with input data cell K55, active cell goes to F56.
If it is possible I need to move it to next page in sheet, and then continue data input according to sub.






Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
With Target

'declare condition to exit sub: single cell + value>0

If .Count > 1 Then Exit Sub
If Not IsNumeric(Target) Then Exit Sub
If .Value <= 0 Then Exit Sub
If .Row > 150 Then Exit Sub
' If do not want trigger change from row n (i.e, from row 10).
'If .Count > 1 Or Not IsNumeric(Target) Or .Value <= 0 Or .Row > 10 Then Exit Sub

Select Case .Column
Case 7, 9 'column F or H
.Offset(0, 2).Select
Case 11 'column I
.Offset(1, -4).Select
Case Else

Exit Sub
End Select


End With

' On error resolving type mismatch error 13

' If Range("K55").Value > 0 Then Range("F56").Offset(13, 1).Select


End Sub
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi all.

Can you please help . I need to move from cell F56 BEFORE NEXT SET OF MEASUREMENTS.
The cell F56 is the last active cell where I am after finishing first set of measurements.


I tried this : If Range("K55").Value > 0 Then Range("F56").Offset(13, 1).Select based of the last entered value K55

but this dont work.

Please help.





Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
With Target

'declare condition to exit sub: single cell + value>0

If .Count > 1 Then Exit Sub
If Not IsNumeric(Target) Then Exit Sub
If .Value <= 0 Then Exit Sub
If .Row > 150 Then Exit Sub
' If do not want trigger change from row n (i.e, from row 10).
'If .Count > 1 Or Not IsNumeric(Target) Or .Value <= 0 Or .Row > 10 Then Exit Sub

Select Case .Column
Case 7, 9 'column F or H
.Offset(0, 2).Select
Case 11 'column I
.Offset(1, -4).Select
Case Else

Exit Sub
End Select


End With
 
Upvote 0
Duplicate to: Including cell offset into known parameters.

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread. If you do not receive a response, you can "bump" it by replying to it yourself, though we advise you to wait 24 hours before doing so, and not to bump a thread more than once a day.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,472
Messages
6,125,011
Members
449,204
Latest member
tungnmqn90

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