Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() How do I make a form that has 2 fields that user can define the range of cells they want to select? For example, if the user enter A1 in the first field, and C3 in the second field, and press the OK button, the cells from A1 to C3 (A1:C3) will be selected? Thank you very much. -- jagexcel ------------------------------------------------------------------------ jagexcel's Profile: http://www.excelforum.com/member.php...o&userid=35657 View this thread: http://www.excelforum.com/showthread...hreadid=554395 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi JagExcel,
Try something like: '============= Public Sub Tester() Dim rng As Range On Error Resume Next Set rng = Application.InputBox _ (Prompt:="Select the required range", _ Type:=8) On Error GoTo 0 If Not rng Is Nothing Then ' do something e.g: rng.Interior.ColorIndex = 6 Else MsgBox "You cancelled" End If End Sub '<<============= --- Regards, Norman "jagexcel" wrote in message ... How do I make a form that has 2 fields that user can define the range of cells they want to select? For example, if the user enter A1 in the first field, and C3 in the second field, and press the OK button, the cells from A1 to C3 (A1:C3) will be selected? Thank you very much. -- jagexcel ------------------------------------------------------------------------ jagexcel's Profile: http://www.excelforum.com/member.php...o&userid=35657 View this thread: http://www.excelforum.com/showthread...hreadid=554395 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() ok, I figured it out. Code: -------------------- Private Sub CommandCancel_Click() Unload Me End Sub ---------------------------------- Private Sub CommandSelect_Click() Range(txtStart.Value, txtEnd.Value).Select End Sub ---------------------------------- Private Sub UserForm_Initialize() txtStart.Value = "" txtEnd.Value = "" txtStart.SetFocus End Sub -------------------- -- jagexcel ------------------------------------------------------------------------ jagexcel's Profile: http://www.excelforum.com/member.php...o&userid=35657 View this thread: http://www.excelforum.com/showthread...hreadid=554395 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks a lot, Norman -- jagexce ----------------------------------------------------------------------- jagexcel's Profile: http://www.excelforum.com/member.php...fo&userid=3565 View this thread: http://www.excelforum.com/showthread.php?threadid=55439 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trying to select a specific range based on the time value of user form input | New Users to Excel | |||
Select Cell Range | Excel Programming | |||
Select last cell in range | Excel Programming | |||
select last cell in used range | Excel Programming | |||
My First User Form - How to Select Range(s) and Print | Excel Programming |