Selection change range question

RedOctoberKnight

Board Regular
Joined
Nov 16, 2015
Messages
150
Office Version
  1. 2016
Platform
  1. Windows
Good Morning,

I have the following formula that i'm using to create horizontal tabs on a worksheet. I'm running into problems with merged cells which are the tabs. I'm not sure how to write the formula so that it accounts for the merged cells. The tabs are merged using cells E3:F4 for one, G3:H4 for another, and I3:J4 for the last.

VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Not Intersect(Target, Range("E3:J3")) Is Nothing Then
    If Target.Column = 5 Then BOARDS_RAMP
    If Target.Column = 6 Then BOARDS_CS
    If Target.Column = 7 Then BOARDS_OPS
  
    End If
    
    



End Sub

Any help would be much appreciated. Thanks
 

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.
Merged problems are a HUGE headache! They are so bad that not only do most "power users" never use them, many will will not even look at at any questions that use them. Merged cells absolutely wreak havoc with VBA and things like sorting.

If you any have ability to eliminate the merged cells, I think you may have more luck getting assistance with your VBA code.
 
Upvote 0
Merged problems are a HUGE headache! They are so bad that not only do most "power users" never use them, many will will not even look at at any questions that use them. Merged cells absolutely wreak havoc with VBA and things like sorting.

If you any have ability to eliminate the merged cells, I think you may have more luck getting assistance with your VBA code.
Thank you for the info. I didn't realize they created such a mess. I will see what I can do without them. Thanks.
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,174
Members
449,071
Latest member
cdnMech

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