Results 1 to 3 of 3

Thread: Assigning Macro to Cell and Running Macro Once Entry in Cell is Complete Without Opening Macro Run Window
Thanks Thanks: 0 Likes Likes: 0

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

    Question Assigning Macro to Cell and Running Macro Once Entry in Cell is Complete Without Opening Macro Run Window

    Hi Everyone,

    I'm new to the whole VBA thing, and need to create a macro that will assign a group of merged cells as text (so you don't have to insert an apostrophe (') to mark it as text (content in the cell will likely commence with a dash (-)), auto-fit the row height of the merged cells, and have that macro assigned to the group of merged cells, with the macro being run when the user hits 'Enter' to move out of the assigned cell.

    Help??

    Thank you so much!

    Jenn

  2. #2
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling, Scotland
    Posts
    75,156
    Post Thanks / Like
    Mentioned
    62 Post(s)
    Tagged
    6 Thread(s)

    Default Re: Assigning Macro to Cell and Running Macro Once Entry in Cell is Complete Without Opening Macro Run Window

    Jenn

    You can't assign a macro to a cell/range, however you might want to consider using the worksheet Change event.

    The worksheet Change event is triggered whenever a change is made on the worksheet, here's the code stub for it,
    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    End Sub
    which goes in the worksheet module.

    If you look at the header of the above sub you'll see that there's an argument, Target, passed to the sub.

    That argument is a reference to the range(s) that on the worksheet that has been changed and you can use it to determine what action to take.
    If posting code please use code tags.

  3. #3
    New Member
    Join Date
    Jun 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Assigning Macro to Cell and Running Macro Once Entry in Cell is Complete Without Opening Macro Run Window

    Thank you for letting me know Norie.

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
  •