+ Reply to Thread
Results 1 to 7 of 7

Adding a dialog box to a macro

  1. #1
    Forum Contributor
    Join Date
    05-13-2005
    Posts
    118

    Adding a dialog box to a macro

    I'm recording a macro that inserts WordArt text into merged cells after rotating the text. Each execution, the text will be slightly different. I want a dialog box to pop up during the run so I can input the batch number, and have Excel do the rest.

    1. What is the command to call up a dialog box?
    2. Can I insert the return value of the dialog box into the Word Art window?

    As for 2, I realized that the copy and paste procedure is inactive once the WordArt box is up. In fact, I've had other problems with pasting in text in the middle of a macro.

    Gary

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208

    Re: Adding a dialog box to a macro

    To use in input box, you can use:

    Please Login or Register  to view this content.
    Then, you can use the strWord variable to use in WordArt:

    Please Login or Register  to view this content.
    HTH,
    Jason

  3. #3
    Forum Contributor
    Join Date
    05-13-2005
    Posts
    118

    Re: Adding a dialog box to a macro

    Jason,

    I pasted in your code into a new macro, but the second part is appearing in red and when i ran it it gave me a syntax error on that line. I did declare the strWord as String, but this still happened.

    btw, what does HTH stand for?

    Gary

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Adding a dialog box to a macro

    Try this:
    Please Login or Register  to view this content.
    btw, what does HTH stand for?
    Hope This Helps.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    05-13-2005
    Posts
    118

    Re: Adding a dialog box to a macro

    That worked. The only thing now is that I wanted a carriage return between the words "batch" and "xxxx" in the dialog box.

    Gary

  6. #6
    Forum Contributor
    Join Date
    05-13-2005
    Posts
    118

    Re: Adding a dialog box to a macro

    I attached the two files again. The code crashes now that I've upgraded to office '07. The macro is stored in batchinsertwheader2.xls, but the data is in Book5.xls. so, both need to be open to run it. It's macro 7.

    Thx,

    Gary
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-13-2005
    Posts
    118

    Re: Adding a dialog box to a macro

    Can someone please take a look at my code? It's been a while.

    Gary

+ 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