Thread: [Solved] Message Box Restriction
View Single Post
 
Old 03-22-2012, 10:38 AM
excelledsoftware excelledsoftware is offline Windows 7 64bit Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Quote:
Originally Posted by Catalin.B View Post
I do not know how your macro looks, but basically, there is a difference between InputBox and Application.InputBox. (I guess you use the first one )
With the last one, you can select the type of data permitted for an entry:
Type:=0 A formula
Type:=1 A number
Type:=2 Text (a string)
Type:=4 A logical value (True or False)
Type:=8 A cell reference, as a Range object
Type:=16 An error value, such as #N/A
Type:=64 An array of values
Code:
Application.InputBox("Enter a number !", Title:="Numbers", Default:=1, Type:=1)
And, as you can see, you can enter a default value if you need that...
Ah, Yes I was using the first one. Here is what my macro looks like right now.

Sub RefreshSelect()
'
' RefreshSelect Macro
' Macro recorded 3/22/2012 by JRErickson
ActiveSheet.PivotTables("PivotTable6").PivotCache. Refresh
Dim Tablenum As Integer
Tablenum = Application.InputBox("Enter Old Style Division Number", Title:="Numbers", Default:=1, Type:=1)
ActiveSheet.PivotTables("PivotTable6").PivotFields ("DIV").CurrentPage = Tablenum
End Sub

Now I just need to restrict it to a list found on another worksheet. Where does that go? in the title?
Reply With Quote