Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default User input as a range

Hello,
I need to get user input for a range of data and then assign this range to
array.

Anyone got any pointers..
Thanks S


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default User input as a range

Sub Tester9()
Dim varr As Variant
Dim rng As Range
On Error Resume Next
Set rng = Application.InputBox("select range with mouse", Type:=8)
On Error GoTo 0
If rng Is Nothing Then Exit Sub
varr = rng.Value
For i = 1 To UBound(varr, 1)
For j = 1 To UBound(varr, 2)
Debug.Print "Varr(" & i & ", " & j & ") = " & varr(i, j)
Next
Next
End Sub

--
Regards,
Tom Ogilvy






"Shane" wrote in message
...
Hello,
I need to get user input for a range of data and then assign this range to
array.

Anyone got any pointers..
Thanks S




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default User input as a range

there are 2 inputbox method's.
VBA's
Inputbox or VBA.inputbox

and Excel's Application.Inputbox

The latter boasts a refedit.. when Type =8

dim rng as range
on error resume next
set rng = Application.Inputbox("Select a Range..",type:=8)
on error goto 0
if rng is nothing then
exit sub 'cancelled
else
msgbox rng.address
endif



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Shane" wrote:

Hello,
I need to get user input for a range of data and then assign this
range to array.

Anyone got any pointers..
Thanks S




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
Prompt user for input and utilize that input ninner Excel Worksheet Functions 2 March 28th 07 09:44 PM
Trying to select a specific range based on the time value of user form input Jitranijam New Users to Excel 8 November 15th 06 12:52 AM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
user input decides cell copy range beatrice25 Excel Discussion (Misc queries) 0 May 17th 06 06:51 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 07:36 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"