What is the format when writing macros in Visual Basic to specify multiple cells. I want to include it in every cell in a column and multiple columns and don't want to type each one individually. Thank You
What is the format when writing macros in Visual Basic to specify multiple cells. I want to include it in every cell in a column and multiple columns and don't want to type each one individually. Thank You
not knowing what kind of code you are talking about I will just give you this bit until you clarify more
Please Login or Register to view this content.
Here is the code:
PrivateSubWorksheet_SelectionChange (ByVal Target As Range)
Select Case Target.Address
Case "$B$5"
Call Open Calendar
End Select
End Sub
However, for case I want to include L4:L311,O4:O311,P4:P311,T4:T311,R4:R:311,V4:V311,W4:W311
Hi,
Hopefully you mean to call a macro when a range is selected(B5)
this type of code will work for multiple target ranges
Please Login or Register to view this content.
jcarstens
Please read forum rules & wrap your VBA code - see links below
If you do not understand the VBA code wrap instructions have a look at my last reply in this thread
http://www.excelforum.com/showthread.php?t=583950
Please Read Forum Rules Before Posting
Wrap VBA code by selecting the code and clicking the # icon or Read This
How To Cross Post politely
Top Excel links for beginners to Experts
If you are pleased with a member's answer then use the Scales icon to rate it
If my reply has assisted or failed to assist you I welcome your Feedback.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks