Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Apps and Programs
Excel Mac 2016 Showing a prompt in an InputBox
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="mitchbvi" data-source="post: 1802709" data-attributes="member: 144376"><p>In the process of transitioning from Excel 2011 to Excel 2016 and have discovered that I cannot show a prompt with "application.inputbox" when asking the operator to select a cell or range.</p><p>I have worked around this by putting the description in the title bar, which does not make a lot of sense. A regular input box when the operators is asked to enter something works OK but that is not what I need. the code I am using is below.</p><p></p><p>[CODE]Sub SortSelCol()</p><p>Dim SortRng As Range, RngKey</p><p>Call LastCell</p><p> If Val(Application.Version) < 15 Then</p><p> Set col1 = Application.InputBox("Select 1st cell in Column to be sorted", Type:=8)</p><p> Else</p><p> 'It appears that one cannot provide a prompt for application.inputbox on mac so have to show prompt in title</p><p> Set col1 = Application.InputBox("", Title:="Select 1st Row of Column to Sort", Type:=8)</p><p> End If</p><p> RngKey = col1.Column</p><p> Range(Cells(col1.Row, col1.Column), Cells(LRow, col1.Column)).Select</p><p> If col1.Column > 1 Then Selection.Interior.ColorIndex = 36</p><p> Set SortRng = Range(Cells(1, 1), Cells(LRow, LCol))</p><p> SortRng.Select</p><p> ActiveWorkbook.Worksheets("Indexed").Sort.SortFields.Clear</p><p> ActiveWorkbook.Worksheets("Indexed").Sort.SortFields.Add Key:=Range(Cells(col1.Row, col1.Column), Cells(LRow, col1.Column)), _</p><p> SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal</p><p> With ActiveWorkbook.Worksheets("Indexed").Sort</p><p> .SetRange Range(Cells(1, 1), Cells(LRow, LCol))</p><p> .Apply</p><p> End With</p><p> Cells(1, 1).Select</p><p>End Sub</p><p>[/CODE]</p><p></p><p>Any suggestions greatly appreciated .</p><p></p><p>Peter</p></blockquote><p></p>
[QUOTE="mitchbvi, post: 1802709, member: 144376"] In the process of transitioning from Excel 2011 to Excel 2016 and have discovered that I cannot show a prompt with "application.inputbox" when asking the operator to select a cell or range. I have worked around this by putting the description in the title bar, which does not make a lot of sense. A regular input box when the operators is asked to enter something works OK but that is not what I need. the code I am using is below. [CODE]Sub SortSelCol() Dim SortRng As Range, RngKey Call LastCell If Val(Application.Version) < 15 Then Set col1 = Application.InputBox("Select 1st cell in Column to be sorted", Type:=8) Else 'It appears that one cannot provide a prompt for application.inputbox on mac so have to show prompt in title Set col1 = Application.InputBox("", Title:="Select 1st Row of Column to Sort", Type:=8) End If RngKey = col1.Column Range(Cells(col1.Row, col1.Column), Cells(LRow, col1.Column)).Select If col1.Column > 1 Then Selection.Interior.ColorIndex = 36 Set SortRng = Range(Cells(1, 1), Cells(LRow, LCol)) SortRng.Select ActiveWorkbook.Worksheets("Indexed").Sort.SortFields.Clear ActiveWorkbook.Worksheets("Indexed").Sort.SortFields.Add Key:=Range(Cells(col1.Row, col1.Column), Cells(LRow, col1.Column)), _ SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("Indexed").Sort .SetRange Range(Cells(1, 1), Cells(LRow, LCol)) .Apply End With Cells(1, 1).Select End Sub [/CODE] Any suggestions greatly appreciated . Peter [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Apps and Programs
Excel Mac 2016 Showing a prompt in an InputBox
Top