ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Select data to imput to macro (https://www.excelbanter.com/excel-discussion-misc-queries/175707-select-data-imput-macro.html)

sofast1651

Select data to imput to macro
 
Regarding the following macro, how do I tell the macro what data to work with
and transfer to one column? Or, how do I select the data and run the macro?

Dave Peterson

Select data to imput to macro
 
You have at least a couple of choices.

You could have the user (you???) select the range first, then run the macro.
Then your macro could work on the current selection.

Or you could ask the user for the range in your macro:

#1.

Dim myRng as range
set myrng = Selection

#2.

Dim myRng as range
set myRng = nothing
on error resume next
set myrng = application.inputbox(Prompt:="Please select a range", type:=8)
on error goto 0

if myrng is nothing then
'user hit cancel
else
'do what you want
end if

But I'm not sure what you're really doing.

sofast1651 wrote:

Regarding the following macro, how do I tell the macro what data to work with
and transfer to one column? Or, how do I select the data and run the macro?


--

Dave Peterson

ShaneDevenshire

Select data to imput to macro
 
Hi,

I don't think your macro got through?

--
Thanks,
Shane Devenshire


"sofast1651" wrote:

Regarding the following macro, how do I tell the macro what data to work with
and transfer to one column? Or, how do I select the data and run the macro?



All times are GMT +1. The time now is 07:15 PM.

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