Writing macro results to user defined areas within excel

  • Thread starter Thread starter gauss1976
  • Start date Start date
G

gauss1976

I am writing macros that manipulate data within excel.

Is it possible to a write a macro that produces a result; say a graph
or a set of values and then get the macro to ask the user where to
place the calculated result/results/graph within excel?

Gauss1976
:confused:
 
You can get a range from the user by something like:

dim DestCell as range
set destcell = nothing
on error resume next
set destcell = Application.inputbox(Prompt:="Please select a cell", _
type:=8).cells(1,1)
on error goto 0

if destcell is nothing then
'user hit cancel, what should happen?
else
'keep going??
end if

Alternatively, you could just tell the user that the output will be placed in
the activecell--so they should select that before they start the macro.

dim destcell as range
set destcell = activecell
.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top