Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Heres the proble...
Dim rng as Range
On Error Resume Next set rng = Application.InputBox("Select a range with your mouse", type:=8) On Error goto 0 if not rng is nothing then rng.Select else msgbox "You cancelled" End if Note that Application.InputBox is not the same as InputBox alone. The latter is the vba inputbox and the former the Excel inputbox. -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... I need to open an uinput box that should ask the user to type in a range. When the user types the range and clicls a button the range shoud appear selected. How difficult is this?? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Heres the proble...
OK but afterwards how do I instruct to graph what has been selected with the
Input Box? "Tom Ogilvy" wrote in message ... Dim rng as Range On Error Resume Next set rng = Application.InputBox("Select a range with your mouse", type:=8) On Error goto 0 if not rng is nothing then rng.Select else msgbox "You cancelled" End if Note that Application.InputBox is not the same as InputBox alone. The latter is the vba inputbox and the former the Excel inputbox. -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... I need to open an uinput box that should ask the user to type in a range. When the user types the range and clicls a button the range shoud appear selected. How difficult is this?? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Heres the proble...
A very simple example:
Sub Macro1() Dim rng As Range On Error Resume Next Set rng = Application.InputBox("Select a range with your mouse", Type:=8) On Error GoTo 0 If Not rng Is Nothing Then rng.Select Else MsgBox "You cancelled" Exit Sub End If Charts.Add ActiveChart.ChartType = xlPie ActiveChart.SetSourceData Source:=rng, PlotBy:= _ xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:=rng.parent.name ActiveChart.HasTitle = False End Sub -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... OK but afterwards how do I instruct to graph what has been selected with the Input Box? "Tom Ogilvy" wrote in message ... Dim rng as Range On Error Resume Next set rng = Application.InputBox("Select a range with your mouse", type:=8) On Error goto 0 if not rng is nothing then rng.Select else msgbox "You cancelled" End if Note that Application.InputBox is not the same as InputBox alone. The latter is the vba inputbox and the former the Excel inputbox. -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... I need to open an uinput box that should ask the user to type in a range. When the user types the range and clicls a button the range shoud appear selected. How difficult is this?? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Heres the proble...
Is there a way to adjust the size of the graph to specific dimensions??
"Tom Ogilvy" wrote in message ... A very simple example: Sub Macro1() Dim rng As Range On Error Resume Next Set rng = Application.InputBox("Select a range with your mouse", Type:=8) On Error GoTo 0 If Not rng Is Nothing Then rng.Select Else MsgBox "You cancelled" Exit Sub End If Charts.Add ActiveChart.ChartType = xlPie ActiveChart.SetSourceData Source:=rng, PlotBy:= _ xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:=rng.parent.name ActiveChart.HasTitle = False End Sub -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... OK but afterwards how do I instruct to graph what has been selected with the Input Box? "Tom Ogilvy" wrote in message ... Dim rng as Range On Error Resume Next set rng = Application.InputBox("Select a range with your mouse", type:=8) On Error goto 0 if not rng is nothing then rng.Select else msgbox "You cancelled" End if Note that Application.InputBox is not the same as InputBox alone. The latter is the vba inputbox and the former the Excel inputbox. -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... I need to open an uinput box that should ask the user to type in a range. When the user types the range and clicls a button the range shoud appear selected. How difficult is this?? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Heres the proble...
A graph on a worksheet is a ChartObject which has top, left, height and
width attributes, so you can set those to size it. With Activesheet.ChartObjects(1) .top = 20 .Left = 20 .Height = 100 .Width = 175 End With -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... Is there a way to adjust the size of the graph to specific dimensions?? "Tom Ogilvy" wrote in message ... A very simple example: Sub Macro1() Dim rng As Range On Error Resume Next Set rng = Application.InputBox("Select a range with your mouse", Type:=8) On Error GoTo 0 If Not rng Is Nothing Then rng.Select Else MsgBox "You cancelled" Exit Sub End If Charts.Add ActiveChart.ChartType = xlPie ActiveChart.SetSourceData Source:=rng, PlotBy:= _ xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:=rng.parent.name ActiveChart.HasTitle = False End Sub -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... OK but afterwards how do I instruct to graph what has been selected with the Input Box? "Tom Ogilvy" wrote in message ... Dim rng as Range On Error Resume Next set rng = Application.InputBox("Select a range with your mouse", type:=8) On Error goto 0 if not rng is nothing then rng.Select else msgbox "You cancelled" End if Note that Application.InputBox is not the same as InputBox alone. The latter is the vba inputbox and the former the Excel inputbox. -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... I need to open an uinput box that should ask the user to type in a range. When the user types the range and clicls a button the range shoud appear selected. How difficult is this?? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Heres the proble...
THANX THANX THANX!!! You guys are great!
"Tom Ogilvy" wrote in message ... A graph on a worksheet is a ChartObject which has top, left, height and width attributes, so you can set those to size it. With Activesheet.ChartObjects(1) .top = 20 .Left = 20 .Height = 100 .Width = 175 End With -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... Is there a way to adjust the size of the graph to specific dimensions?? "Tom Ogilvy" wrote in message ... A very simple example: Sub Macro1() Dim rng As Range On Error Resume Next Set rng = Application.InputBox("Select a range with your mouse", Type:=8) On Error GoTo 0 If Not rng Is Nothing Then rng.Select Else MsgBox "You cancelled" Exit Sub End If Charts.Add ActiveChart.ChartType = xlPie ActiveChart.SetSourceData Source:=rng, PlotBy:= _ xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:=rng.parent.name ActiveChart.HasTitle = False End Sub -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... OK but afterwards how do I instruct to graph what has been selected with the Input Box? "Tom Ogilvy" wrote in message ... Dim rng as Range On Error Resume Next set rng = Application.InputBox("Select a range with your mouse", type:=8) On Error goto 0 if not rng is nothing then rng.Select else msgbox "You cancelled" End if Note that Application.InputBox is not the same as InputBox alone. The latter is the vba inputbox and the former the Excel inputbox. -- Regards, Tom Ogilvy "Edwin Merced" wrote in message ... I need to open an uinput box that should ask the user to type in a range. When the user types the range and clicls a button the range shoud appear selected. How difficult is this?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Heres the proble... | Excel Programming | |||
Heres the proble... | Excel Programming | |||
Heres the proble... | Excel Programming | |||
Heres the proble... | Excel Programming | |||
heres one for ya.. | Excel Programming |