Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.Dialogs(xlDialogPrint).Show - prints too soon Almagg via OfficeKB.com Excel Discussion (Misc queries) 3 April 27th 07 08:17 PM
are default values possible for "Application.Dialogs(xlDialogSortSpecial).show "? broro183[_13_] Excel Programming 4 January 17th 06 10:46 AM
Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen) Paul Martin Excel Programming 5 August 5th 05 04:44 PM
Problems with application.Dialogs(xlDialogFormulaFind).Show lydya Excel Programming 2 December 18th 04 05:02 PM
How to disable the Application Dialogs Philip Excel Programming 1 November 5th 04 08:50 PM


All times are GMT +1. The time now is 09:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"