+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Message box creation

  1. #1
    Forum Contributor
    Join Date
    08-04-2010
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    110

    Message box creation

    Hi guys.

    I have a macro that creates a sheet from data refreshed from an external source.
    This macro checks the data for changes and notifies you of the changes to prevent amendments from going unnoticed.
    Currently, what it does is filter the data, copy it, create a new sheet and paste it into the new sheet.
    This is a very clunky way to do it in my opinion.
    What I want it to do, is put the information in a MsgBox so the user can spot it, then click ok to dismiss once they know it's taken care of.

    Is there any way for a macro to create a message box from copied/pasted data?
    Or are they limited only to data pre-entered before the macro run?

    Or, is there another way around it? Userforms or something?

    Thanks in advance for any help.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Message box creation

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    08-04-2010
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    110

    Re: Message box creation

    Ok
    I'll try, this isn't an easy thing to explain.
    The dummy sheet has 2 tabs, what the sheet looks like before, and after refreshing.

    The macro copies the data of the original, and pastes it into column S.
    This provides the conditional formatting with an original copy of the data to compare to for Unique or duplicate values.
    You'll notice on the after sheet, that the column S is populated as per that example.
    You'll also notice column P has a LEN formula to count the amount of characters in the cells in column A.
    A9 has been amended, and as such, the conditional formatting identifies it as red.

    My macro, then produces an autofilter, that filters column A by the colour red, and column P by the number 8, as amended trades have 8 characters.
    The LEN is required as if new data comes into the sheet, because it is Unique data, it also gets coloured red. So, the LEN identifies amended trades only.

    Once the autofilter is applied, the macro copies the data that is in the autofilter range, and pastes to a new sheet.

    What I need is to replace the copy and paste to a new workbook, with the amended trade appearing in a Message Box in the centre of the screen.

    Please let me know if I haven't been clear enough.
    It's been a long process getting the sheet to this point.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    08-04-2010
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    110

    Re: Message box creation

    I've managed to get this code, which puts my filtered range into a Message Box (YAY!!!)
    Please Login or Register  to view this content.
    Problem is, it displays all the data on the same line, only wrapping the data when there is too much for that line.

    What I need, is for each line of data to be displayed on a seperate line.
    Any idea how to seperate the data lines?
    Data is only in columns A to D.

  5. #5
    Forum Contributor
    Join Date
    08-04-2010
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    110

    Re: Message box creation

    Sorry to bump this.
    But all my Google searches are drawing a blank.

    Would putting my data into an array help?

    If so, how do you go about putting an autofiltered range into an array?

+ 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