View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Need help with creating a special copy and paste macro

Arguments are set using colon equal

set rng = Application.InputBox(Prompt:="Select a range with the mouse", _
Type:=8)

put this in a module, then highlight Application.InputBox and hit F1 to get
help on the function. This should show you what other agruments you have
available. It also will explain what the type argument does.

Note that Application.Inputbox gives you the Excel inputbox which is
different from the VBA inputbox.

ans = InputBox(Prompt:="Type your name")

is different from

ans = Application.InputBox(Prompt:="Type your name", Type:=2)

although the differences may be subtle for many uses. The
application.Inputbox actually acts as a virtual cell, so you could type in a
formula same as in a cell and it would be evaluated. so for the example,
where a string is expected, I could type in

="ABC " & G9

ans would hold the concatenation of the string "ABC " and whatever is in
cell G9 of the active sheet.

--
Regards,
Tom Ogilvy



"Shawn Hobbs" wrote in message
...

Thanks Tom,

I'm still in the process of learning how to right application. I will
try to figure this all out.

Thanks again for the start. It can only get better from this point.

I have just one question: In the Application.Inputbox, you typed"(
Type:=8)", is it written exactly as that or just "type=8". And is
setting the type of input box I have?

Thanks
Shawng


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!