Reset multiple dependent drop down boxes in a spread sheet.

Tarnz

New Member
Joined
Aug 19, 2024
Messages
2
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
I'm totally new to VBA and this is my first attempt which is failing due to I think they all try to run and overlap causing the wrong boxes to reset. Please can someone advise me how to correct this I have searched so many threads trying to find and answer.


Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A226:A290")) Is Nothing Then
ActiveCell.Offset(0, 6).Range("A1").Value = "Please Select"

End If

If Not Intersect(Target, Range("G226:G290")) Is Nothing Then
ActiveCell.Offset(0, 1).Range("A1").Value = "Please Select"

End If

If Not Intersect(Target, Range("R226:R290")) Is Nothing Then
ActiveCell.Offset(0, 1).Range("A1").Value = "Please Select"

End If

If Not Intersect(Target, Range("A302:A310")) Is Nothing Then
ActiveCell.Offset(0, 6).Range("A1").Value = "Please Select"

End If

If Not Intersect(Target, Range("G302:G310")) Is Nothing Then
ActiveCell.Offset(0, 1).Range("A1").Value = "Please Select"

End If

End Sub
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Is it only cell “A1” or other cells that you want to change the value to “Please Select” if Target is not empty?

because this code makes me quite ambiguous
ActiveCell.Offset(0, 1).Range("A1").Value
 
Upvote 0
Is it only cell “A1” or other cells that you want to change the value to “Please Select” if Target is not empty?

because this code makes me quite ambiguous
no I'm not changing the actual A1 cell See image I am trying to get A226 if it has a change to rest cell G226 then is G226 has a change it will then reset H226. the first will work but when i put in the others it gets confused and resets B226 and L226. I have rows and rows of data that needs to reset also.
 

Attachments

  • Excel Capture.JPG
    Excel Capture.JPG
    35.3 KB · Views: 3
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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