+ Reply to Thread
Results 1 to 2 of 2

How to run macro in excel using private sub below coding

  1. #1
    Registered User
    Join Date
    01-30-2020
    Location
    Chennai
    MS-Off Ver
    365
    Posts
    1

    How to run macro in excel using private sub below coding

    Iím just a beginner , please help

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("$E$3").Value = "Selection A" Then
    Range("$L$3").Value = Sheets("sheet2").Range("$M$4").Value
    With Range("L3:R4").Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
    xlBetween, Formula1:="=selection_a"
    .IgnoreBlank = False
    .InCellDropdown = True
    .InputTitle = ""
    .ErrorTitle = ""
    .InputMessage = ""
    .ErrorMessage = ""
    .ShowInput = True
    .ShowError = True
    End With
    End If

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex
    MS-Off Ver
    2010 & 2016
    Posts
    5,360

    Re: How to run macro in excel using private sub below coding

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    BSB

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1