Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Input box range - output range

Sub UniqueFindColumn()
Dim AnArray() As String, i As Long
Dim Selec As Range
Dim Desti As Range
Set Selec = Application.InputBox( _
Prompt:="Select cell for Actual data.", Type:=8)

Set Desti = Application.InputBox( _
Prompt:="Select cell for Actual data.", Type:=8)
AnArray = GetUniqueEntries(Selec)
If Len(AnArray(0)) 0 Then
For i = 0 To UBound(AnArray)
Range(Desti).Offset(i, 0) = AnArray(i)
Next
End If
End Sub

What wrong in the above macro with respect to my output i.e Desti
range.
Thxs

Actual I tried to amend the macro below:
Sub UniqueFind()
Dim AnArray() As String, i As Long
AnArray = GetUniqueEntries(Range("A1:D12"))
If Len(AnArray(0)) 0 Then
For i = 0 To UBound(AnArray)
Range("F1").Offset(i, 0) = AnArray(i)
Next
End If
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Input box range - output range


Hello al007,

The range object variables must be set to an existing reference. I made
the changes to your code for you. The InputBox is merely supplying a
string address that describes the range and is not itself a range. You
can not reference cells that are not on the active sheet with this
Sub.

Sub UniqueFindColumn()
Dim AnArray() As String, i As Long
Dim Selec As Range
Dim Desti As Range
Dim Rng
Rng = Application.InputBox( _
Prompt:="Select cell for Actual data.", Type:=8)
Set Selec = Range(Rng)

Rng = Application.InputBox( _
Prompt:="Select cell for Actual data.", Type:=8)
Set Desti = Range(Rng)
AnArray = GetUniqueEntries(Selec)
If Len(AnArray(0)) 0 Then
For i = 0 To UBound(AnArray)
Range(Desti).Offset(i, 0) = AnArray(i)
Next
End If
End Sub


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=486773

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Input box range - output range

Ross,
The code is stopping at

Set Selec = Range(Rng)

PLs help

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Input box range - output range


Hello al007,

What did you type into the input box?

Thanks,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=486773

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Input box range - output range

My selected range e.g A1:D12
My desti range e.g F1


Guess code need to amended

thxs



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Input box range - output range

Desti is already a range.

I think you want:
Desti.Offset(i, 0) = AnArray(i)

instead of:
Range(Desti).Offset(i, 0) = AnArray(i)


al007 wrote:

Sub UniqueFindColumn()
Dim AnArray() As String, i As Long
Dim Selec As Range
Dim Desti As Range
Set Selec = Application.InputBox( _
Prompt:="Select cell for Actual data.", Type:=8)

Set Desti = Application.InputBox( _
Prompt:="Select cell for Actual data.", Type:=8)
AnArray = GetUniqueEntries(Selec)
If Len(AnArray(0)) 0 Then
For i = 0 To UBound(AnArray)
Range(Desti).Offset(i, 0) = AnArray(i)
Next
End If
End Sub

What wrong in the above macro with respect to my output i.e Desti
range.
Thxs

Actual I tried to amend the macro below:
Sub UniqueFind()
Dim AnArray() As String, i As Long
AnArray = GetUniqueEntries(Range("A1:D12"))
If Len(AnArray(0)) 0 Then
For i = 0 To UBound(AnArray)
Range("F1").Offset(i, 0) = AnArray(i)
Next
End If
End Sub


--

Dave Peterson
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
Forumla that Looks up a range of output from one cell DKinNorthCakalacki Excel Worksheet Functions 2 August 27th 08 03:45 AM
List Box - For Input Range can I use named range in another workbo dim Excel Worksheet Functions 2 January 3rd 08 06:10 PM
Print output does not contain entire range gwpicasso Excel Discussion (Misc queries) 0 August 17th 07 02:17 AM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM
Macro to input formula in range based on another range Peter Atherton Excel Programming 0 October 9th 03 12:47 AM


All times are GMT +1. The time now is 09:40 AM.

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"