Multi Data Validation Selection Macro

RagingBokky

New Member
Joined
May 27, 2017
Messages
12
Hi Everyone,

First time on this forum, since most time I just use the general google search vba macro [item I want to simulate] and most time it has been a charm to read and build my own version

I am kind of a novice programmer but ok at it as most things I do is general console base c programming and not so much of this windows API stuff!!

anyways what I want to achieve with my email generator macro

A1 has a prefilled data validation upon selecting an option it will generate a prefilled email with certain input email while maintaining box still saying 1 word and also removing B1 data validation (got that working)

Upon selecting a certain item in A1 it should generate its own Data Validation into B2 while maintaining saying 1 word after selecting (got that that working)

The problem I am currently stuck on is after I select this item in A1 and it generates the second data validation into B1 If I select an item in B1 it won't generate an email for that option selected in that

The function I'm trying to use in my private sub is case statement but I am not sure how to use it exactly or perfectly for that matter

Code:
[IMG]http://icons.iconarchive.com/icons/double-j-design/ravenna-3d/24/File-Copy-icon.png[/IMG]Private Sub Worksheet_Change(ByVal Target As Range)
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">If Not Intersect(Target, Range("A1")) Is Nothing Then
    Select Case Range("A1")
        Case "EoDSL":    EoDSLemail
        Case "EoEDSL":  EoEDSLemail
        Case "EoNBN":   EoNBNMenu
        Case "EoTWEA": EoTWEAemail
    Select Case Range("B1")
        Case "FTTP":      FTTPemail 
    End Select
End If
End Sub
</code>

Thank you all for helping such a novice!!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi all,

I end up finding out my solution awhile ago but forgot to add it here. it just turns out i failed to use the "if" statements below is the result that worked in the end

Code:
Private Sub Worksheet_Change(ByVal Target As Range)    If Not Intersect(Target, Range("A1")) Is Nothing Then
        Select Case Range("A1")
            Case "EoDSL":   EoDSLemail
            Case "EoEDSL":  EoEDSLemail
            Case "EoNBN":   EoNBNMenu
            Case "EoTWEA":   EoTWEAemail
        End Select
    ElseIf Not Intersect(Target, Range("B1")) Is Nothing Then
        Select Case Range("B1")
            Case "FTTP": FTTPemail
            Case "FTTN": FTTNemail
            Case "FTTB": FTTBemail
            Case "Fix Wireless": FixWirelessemail
        End Select
    ElseIf Not Intersect(Target, Range("A13")) Is Nothing Then
        Select Case Range("A13")
            Case "Data":    Dataemail
            Case "Voice":  Voiceemail
        End Select
    End If
    End Sub
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,052
Latest member
Fuddy_Duddy

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