Change Cell Button to apply to all selected cells
Results 1 to 5 of 5

Thread: Change Cell Button to apply to all selected cells

  1. #1
    New Member
    Join Date
    Aug 2019
    Posts
    49
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Post Change Cell Button to apply to all selected cells

    I have had a request from management. I have the following macro assigned to a button

    Code:
    Sub TaskNotDone ()
        With ActiveCell
        .Value = "N/A"
        End With
    
    End Sub
    This changes the active cell to N/A

    is there a way I can have this work if there are multiple cells selected. The guys find the one by one method too slow. The want to select multiple cells and press a button to apply N/A to them all

    Thanks

    Regards

    Jason Bing

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    26,976
    Post Thanks / Like
    Mentioned
    459 Post(s)
    Tagged
    45 Thread(s)

    Default Re: Change Cell Button to apply to all selected cells

    How about
    Code:
       Selection.Value = "N/A"
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    Board Regular
    Join Date
    Feb 2010
    Location
    London, UK
    Posts
    9,282
    Post Thanks / Like
    Mentioned
    24 Post(s)
    Tagged
    3 Thread(s)

    Default Re: Change Cell Button to apply to all selected cells

    Try:
    Code:
    Sub TaskNotDone
    Selection.Value = "N/A"
    End Sub


  4. #4
    New Member
    Join Date
    Aug 2019
    Posts
    49
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Change Cell Button to apply to all selected cells

    Well that was obvious. I am a VBA Student, I have much learning to do

    Thanks Guys

    Regards

    Jason Bing

  5. #5
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    26,976
    Post Thanks / Like
    Mentioned
    459 Post(s)
    Tagged
    45 Thread(s)

    Default Re: Change Cell Button to apply to all selected cells

    Glad we could help & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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