ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get user to select cell (https://www.excelbanter.com/excel-programming/413289-how-get-user-select-cell.html)

CLR

How to get user to select cell
 
Hi all.........

I would like to select a sheet (no problem there),............ then I would
like a msgbox to pop up telling the user to select a cell (no problem
there),.......... then I would like for the macro to pause until the user to
selects a cell.......and then for the macro to continue to run using that
cell as the selection.

TIA
Vaya con Dios,
Chuck, CABGx3





FSt1

How to get user to select cell
 
hi
you could use a input box instead and have them enter the cell address.

Dim stg As String
stg = InputBox("enter cell address")
MsgBox stg 'for test only
Range(stg).Select 'for test only

regards
FSt1

"CLR" wrote:

Hi all.........

I would like to select a sheet (no problem there),............ then I would
like a msgbox to pop up telling the user to select a cell (no problem
there),.......... then I would like for the macro to pause until the user to
selects a cell.......and then for the macro to continue to run using that
cell as the selection.

TIA
Vaya con Dios,
Chuck, CABGx3






CLR

How to get user to select cell
 
Thank you, but no.......in this instance I want the user to select a
cell........

Vaya con Dios,
Chuck, CABGx3




"FSt1" wrote in message
...
hi
you could use a input box instead and have them enter the cell address.

Dim stg As String
stg = InputBox("enter cell address")
MsgBox stg 'for test only
Range(stg).Select 'for test only

regards
FSt1

"CLR" wrote:

Hi all.........

I would like to select a sheet (no problem there),............ then I

would
like a msgbox to pop up telling the user to select a cell (no problem
there),.......... then I would like for the macro to pause until the

user to
selects a cell.......and then for the macro to continue to run using

that
cell as the selection.

TIA
Vaya con Dios,
Chuck, CABGx3








Dave Peterson

How to get user to select cell
 
Dim myCell as range
set mycell = nothing
on error resume next 'cancel will cause an error
set mycell = application.inputbox(Prompt:="select a cell", type:=8).cells(1)
on error goto 0

if mycell is nothing then
msgbox "You didn't select a cell!"
else
msgbox "You selected: " & mycell.address(external:=true)
end if



CLR wrote:

Hi all.........

I would like to select a sheet (no problem there),............ then I would
like a msgbox to pop up telling the user to select a cell (no problem
there),.......... then I would like for the macro to pause until the user to
selects a cell.......and then for the macro to continue to run using that
cell as the selection.

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson

CLR

How to get user to select cell
 
Got it Dave, and it does me fine...........thank you most kindly.......

BTW.......what does the Type:=8 mean, and are there other choices?

Vaya con Dios,
Chuck, CABGx3



"Dave Peterson" wrote in message
...
Dim myCell as range
set mycell = nothing
on error resume next 'cancel will cause an error
set mycell = application.inputbox(Prompt:="select a cell",

type:=8).cells(1)
on error goto 0

if mycell is nothing then
msgbox "You didn't select a cell!"
else
msgbox "You selected: " & mycell.address(external:=true)
end if



CLR wrote:

Hi all.........

I would like to select a sheet (no problem there),............ then I

would
like a msgbox to pop up telling the user to select a cell (no problem
there),.......... then I would like for the macro to pause until the

user to
selects a cell.......and then for the macro to continue to run using

that
cell as the selection.

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson




Dave Peterson

How to get user to select cell
 
I hope that there are other choices--or what the heck was MS thinking when
starting with type:=8. <vbg

Type:=8 means that you want to return a range.

If you search VBA's help for inputbox method (not inputbox function), you'll
see:

Type Optional Variant. Specifies the return data type. If this argument is
omitted, the dialog box returns text. Can be one or a sum of the following
values.

Value Meaning
0 A formula
1 A number
2 Text (a string)
4 A logical value (True or False)
8 A cell reference, as a Range object
16 An error value, such as #N/A
64 An array of values

You can use the sum of the allowable values for Type. For example, for an input
box that can accept both text and numbers, set Type to 1 + 2.




CLR wrote:

Got it Dave, and it does me fine...........thank you most kindly.......

BTW.......what does the Type:=8 mean, and are there other choices?

Vaya con Dios,
Chuck, CABGx3

"Dave Peterson" wrote in message
...
Dim myCell as range
set mycell = nothing
on error resume next 'cancel will cause an error
set mycell = application.inputbox(Prompt:="select a cell",

type:=8).cells(1)
on error goto 0

if mycell is nothing then
msgbox "You didn't select a cell!"
else
msgbox "You selected: " & mycell.address(external:=true)
end if



CLR wrote:

Hi all.........

I would like to select a sheet (no problem there),............ then I

would
like a msgbox to pop up telling the user to select a cell (no problem
there),.......... then I would like for the macro to pause until the

user to
selects a cell.......and then for the macro to continue to run using

that
cell as the selection.

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson


--

Dave Peterson

CLR

How to get user to select cell
 
I guess that's why you get the Big Bucks, Dave <g

Thanks most kindly,
Vaya con Dios,
Chuck, CABGx3



"Dave Peterson" wrote in message
...
I hope that there are other choices--or what the heck was MS thinking when
starting with type:=8. <vbg

Type:=8 means that you want to return a range.

If you search VBA's help for inputbox method (not inputbox function),

you'll
see:

Type Optional Variant. Specifies the return data type. If this argument

is
omitted, the dialog box returns text. Can be one or a sum of the following
values.

Value Meaning
0 A formula
1 A number
2 Text (a string)
4 A logical value (True or False)
8 A cell reference, as a Range object
16 An error value, such as #N/A
64 An array of values

You can use the sum of the allowable values for Type. For example, for an

input
box that can accept both text and numbers, set Type to 1 + 2.




CLR wrote:

Got it Dave, and it does me fine...........thank you most kindly.......

BTW.......what does the Type:=8 mean, and are there other choices?

Vaya con Dios,
Chuck, CABGx3

"Dave Peterson" wrote in message
...
Dim myCell as range
set mycell = nothing
on error resume next 'cancel will cause an error
set mycell = application.inputbox(Prompt:="select a cell",

type:=8).cells(1)
on error goto 0

if mycell is nothing then
msgbox "You didn't select a cell!"
else
msgbox "You selected: " & mycell.address(external:=true)
end if



CLR wrote:

Hi all.........

I would like to select a sheet (no problem there),............ then

I
would
like a msgbox to pop up telling the user to select a cell (no

problem
there),.......... then I would like for the macro to pause until the

user to
selects a cell.......and then for the macro to continue to run using

that
cell as the selection.

TIA
Vaya con Dios,
Chuck, CABGx3

--

Dave Peterson


--

Dave Peterson




Dave Peterson

How to get user to select cell
 
When BillG, WarrenB and go out, I always pick up the tab!



CLR wrote:

I guess that's why you get the Big Bucks, Dave <g

Thanks most kindly,
Vaya con Dios,
Chuck, CABGx3

"Dave Peterson" wrote in message
...
I hope that there are other choices--or what the heck was MS thinking when
starting with type:=8. <vbg

Type:=8 means that you want to return a range.

If you search VBA's help for inputbox method (not inputbox function),

you'll
see:

Type Optional Variant. Specifies the return data type. If this argument

is
omitted, the dialog box returns text. Can be one or a sum of the following
values.

Value Meaning
0 A formula
1 A number
2 Text (a string)
4 A logical value (True or False)
8 A cell reference, as a Range object
16 An error value, such as #N/A
64 An array of values

You can use the sum of the allowable values for Type. For example, for an

input
box that can accept both text and numbers, set Type to 1 + 2.




CLR wrote:

Got it Dave, and it does me fine...........thank you most kindly.......

BTW.......what does the Type:=8 mean, and are there other choices?

Vaya con Dios,
Chuck, CABGx3

"Dave Peterson" wrote in message
...
Dim myCell as range
set mycell = nothing
on error resume next 'cancel will cause an error
set mycell = application.inputbox(Prompt:="select a cell",
type:=8).cells(1)
on error goto 0

if mycell is nothing then
msgbox "You didn't select a cell!"
else
msgbox "You selected: " & mycell.address(external:=true)
end if



CLR wrote:

Hi all.........

I would like to select a sheet (no problem there),............ then

I
would
like a msgbox to pop up telling the user to select a cell (no

problem
there),.......... then I would like for the macro to pause until the
user to
selects a cell.......and then for the macro to continue to run using
that
cell as the selection.

TIA
Vaya con Dios,
Chuck, CABGx3

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

Dave Peterson

How to get user to select cell
 
Something ate my I.

Ouch!!!!!!!!

Dave Peterson wrote:

When BillG, WarrenB and go out, I always pick up the tab!

CLR wrote:

I guess that's why you get the Big Bucks, Dave <g

Thanks most kindly,
Vaya con Dios,
Chuck, CABGx3

"Dave Peterson" wrote in message
...
I hope that there are other choices--or what the heck was MS thinking when
starting with type:=8. <vbg

Type:=8 means that you want to return a range.

If you search VBA's help for inputbox method (not inputbox function),

you'll
see:

Type Optional Variant. Specifies the return data type. If this argument

is
omitted, the dialog box returns text. Can be one or a sum of the following
values.

Value Meaning
0 A formula
1 A number
2 Text (a string)
4 A logical value (True or False)
8 A cell reference, as a Range object
16 An error value, such as #N/A
64 An array of values

You can use the sum of the allowable values for Type. For example, for an

input
box that can accept both text and numbers, set Type to 1 + 2.




CLR wrote:

Got it Dave, and it does me fine...........thank you most kindly.......

BTW.......what does the Type:=8 mean, and are there other choices?

Vaya con Dios,
Chuck, CABGx3

"Dave Peterson" wrote in message
...
Dim myCell as range
set mycell = nothing
on error resume next 'cancel will cause an error
set mycell = application.inputbox(Prompt:="select a cell",
type:=8).cells(1)
on error goto 0

if mycell is nothing then
msgbox "You didn't select a cell!"
else
msgbox "You selected: " & mycell.address(external:=true)
end if



CLR wrote:

Hi all.........

I would like to select a sheet (no problem there),............ then

I
would
like a msgbox to pop up telling the user to select a cell (no

problem
there),.......... then I would like for the macro to pause until the
user to
selects a cell.......and then for the macro to continue to run using
that
cell as the selection.

TIA
Vaya con Dios,
Chuck, CABGx3

--

Dave Peterson

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com