How to add multiple VBA codes on one worksheet

Hello there, I want to lock particular culumn.. i want them to be automatically locked after the value is change… and i tried this code..

Private Sub Worksheet_Change(ByVal Target As Range)

    Dim MyRange As Range

 

    Set MyRange = Intersect(Range(“C56:C72”), Target)

    If Not MyRange Is Nothing Then

        Sheets(“Sheet1″).Unprotect Password:=”HELLO”

        MyRange.Locked = True

        Sheets(“Sheet1″).Protect Password:=”HELLO”

    End If

End Sub

 

i want to use this same code expect This Line twice in a same worksheet

Set MyRange = Intersect(Range(“C56:C72”), Target) ,I want to change the value of this line from “C56:C72” to “C6:AI36”

But when i try to do this, i always get an error called  Ambiguous

error…

So please solve my problem….

 

 

By: Md Mamun

367 thoughts on “How to add multiple VBA codes on one worksheet

  1. Baixar Aplicativo Brasil Tv

    Ponto IPTV a melhor programacao de canais IPTV do Brasil, filmes, series, futebol, lutas, shows, documentarios em alta definicao de imagem e som em SD, HD, FULL HD, 4K. compativel com todos aparelhos do mercado Brasileiro.

  2. App De Iptv Para Tv Samsung

    Ponto IPTV a melhor programacao de canais IPTV do Brasil, filmes, series, futebol, lutas, shows, documentarios em alta definicao de imagem e som em SD, HD, FULL HD, 4K. compativel com todos aparelhos do mercado Brasileiro.

  3. click here

    IaаАа’б‚Т€ТšаЂаŒаАа’б‚Т€ТžаБТžm a lengthy time watcher and I just considered IaаАа’б‚Т€ТšаЂаŒаАа’б‚Т€ТžаБТžd drop by and say hello there there for the very initially time.

  4. Aplicativo Da Tv Digital

    Ponto IPTV a melhor programacao de canais IPTV do Brasil, filmes, series, futebol, lutas, shows, documentarios em alta definicao de imagem e som em SD, HD, FULL HD, 4K. compativel com todos aparelhos do mercado Brasileiro.

Comments are closed.