View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Select column that matches a value entered in a User Form TextBox

Sorry... it looks like I posted my response to the wrong message thread.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
Something like this maybe...

Sub AutoFitRowHeightWhenNecessary()
Dim R As Range
Dim CurrentHeight As Double
Const MinRowHeight As Double = 51
On Error GoTo Whoops
Application.ScreenUpdating = False
For Each R In Worksheets("Sheet1").UsedRange.Rows
R.AutoFit
If R.RowHeight < MinRowHeight Then
R.RowHeight = MinRowHeight
End If
Next
Whoops:
Application.ScreenUpdating = True
End Sub

--
Rick (MVP - Excel)


"Gwyzor" wrote in message
...
I am building an Excel 2007 User Form in VB. I want my users to be able
to
type the day of month (i.e. 6 for the 6th of the month) and have code
that
automatically selects the column that is set up for that date to be used.
Each column has the day of the month as the top field of the column.
Therefore, if they type '6', I want to select the equal value, '6' in the
day
column, and use that column. Have tried several functions, and am not
coming
up with the correct code to accomplish this.