+ Reply to Thread
Results 1 to 3 of 3

returning values application.dialogs(...).show

  1. #1
    Pringles.
    Guest

    returning values application.dialogs(...).show

    is there any way to maybe return any other (besides the boolean) value from,
    for example Application.Dialogs(xlDialogFormatNumber)?

  2. #2
    Dave Peterson
    Guest

    Re: returning values application.dialogs(...).show

    Select a cell (on a new temporary worksheet???)
    show the dialog
    rectrieve the numberformat for that cell
    delete the worksheet

    Pringles. wrote:
    >
    > is there any way to maybe return any other (besides the boolean) value from,
    > for example Application.Dialogs(xlDialogFormatNumber)?


    --

    Dave Peterson

  3. #3
    Jon Peltier
    Guest

    Re: returning values application.dialogs(...).show

    Dave -

    Excellent. I had the same question, and this little sequence works great.

    Function GetFormat(Optional sDefault As String = "")
    Dim b As Boolean
    Dim s As String
    Dim ws As Worksheet

    Application.ScreenUpdating = False

    Set ws = Workbooks.Add.Worksheets(1)

    If Len(sDefault) > 0 Then
    ActiveCell.NumberFormat = sDefault
    End If

    b = Application.Dialogs(xlDialogFormatNumber).Show

    s = ActiveCell.NumberFormat

    Application.DisplayAlerts = False
    ws.Parent.Close False
    Application.DisplayAlerts = True

    Application.ScreenUpdating = True

    GetFormat = s

    End Function

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Tutorials and Custom Solutions
    http://PeltierTech.com
    _______


    "Dave Peterson" wrote:

    > Select a cell (on a new temporary worksheet???)
    > show the dialog
    > rectrieve the numberformat for that cell
    > delete the worksheet
    >
    > Pringles. wrote:
    > >
    > > is there any way to maybe return any other (besides the boolean) value from,
    > > for example Application.Dialogs(xlDialogFormatNumber)?

    >
    > --
    >
    > Dave Peterson
    >


+ 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