Dim wks as worksheet
set wks = nothing
on error resume next
set wks = application.inputbox _
(Prompt:="please click on a cell in the worksheet to use", type:=8).parent
on error resume next
if wks is nothing then
'user hit cancel, what should happen
else
msgbox wks.name
end if
You may want to consider creating a userform that displays the worksheet names
(in comboboxes??) and allow the user to select the sheet from that list.
If you want to try, take a look at the userform in Myrna Larson and Bill
Manville's compare program:
http://www.cpearson.com/excel/whatsnew.htm
look for compare.xla
Yossi evenzur wrote:
>
> How or what is the vba syntax if i want the user to select a atrget sheet for
> a macro as an input?
--
Dave Peterson