Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Query the User for Cell Location

I am writing a simple macro that takes some cell values that I have retrieved
from a separate worksheet and would like to place them in a new location in
another worksheet. Navigating between the worksheets is not a problem but I
am not sure how to query the user to select the destination cell(s) for the
copied values. I would like to do it via a standard mouse click rather than
typing them in a userinput box if possible. Suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Query the User for Cell Location

Hi Chris,

Chris wrote:
I am writing a simple macro that takes some cell values that I have
retrieved from a separate worksheet and would like to place them in a
new location in another worksheet. Navigating between the worksheets
is not a problem but I am not sure how to query the user to select
the destination cell(s) for the copied values. I would like to do it
via a standard mouse click rather than typing them in a userinput box
if possible. Suggestions?


You could use Application.InputBox with Type:=8 to do this:

Application.InputBox Prompt:="Please enter or select a " & _
"destination range.", Type:=8

You'll want to get the selected range back (while handling cancels/etc), so
it will probably look more like this:

Sub test()
Dim rngDest As Range

On Error Resume Next
Set rngDest = Application.InputBox(Prompt:= _
"Please enter or select a destination range.", _
Type:=8)
On Error GoTo 0

If Not rngDest Is Nothing Then
MsgBox "Selected: '" & rngDest.Address & "'."
Else
MsgBox "Cancelled"
End If

Set rngDest = Nothing
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Query the User for Cell Location

Create a user form & add a RefEdit to it.

Create a function that shows the UserForm & returns the content of the RefEdit.



"Chris" wrote in message ...
I am writing a simple macro that takes some cell values that I have retrieved
from a separate worksheet and would like to place them in a new location in
another worksheet. Navigating between the worksheets is not a problem but I
am not sure how to query the user to select the destination cell(s) for the
copied values. I would like to do it via a standard mouse click rather than
typing them in a userinput box if possible. Suggestions?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Location of MS Query Application FARAZ QURESHI Excel Discussion (Misc queries) 3 May 9th 23 03:45 AM
MS Query SQL File Location Richard Excel Discussion (Misc queries) 3 February 2nd 07 08:13 PM
MS Query File Location Richard Excel Discussion (Misc queries) 0 January 31st 07 12:52 AM
ms query file location busypgmr Setting up and Configuration of Excel 0 September 5th 06 09:46 PM
Excel User Conference - US location Damon Longworth Excel Discussion (Misc queries) 2 July 6th 05 10:58 PM


All times are GMT +1. The time now is 04:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"