PDA

View Full Version : Send Var With range to/from Form



russkie
10-21-2005, 11:16 AM
Hello,
In the macro i have a Var that hold the range:

Dim InvCell As Range
Dim ItemFound(10, 2), i As Long
Dim RmmbrItem As Range
Set WS1 = Worksheets("Sheet1")

With WS1.Range("B:B")
Set InvCell = .Find(scanned, lookat:=xlWhole)
If Not InvCell Is Nothing Then
Firstaddress = InvCell.address
Set RmmbrItem = InvCell

Do
Set InvCell = .FindNext(InvCell)
If Not InvCell Is Nothing Then
i = i + 1
ItemFound(i, 1) = InvCell.Value
ItemFound(i, 2) = InvCell.Offset(0, -1).Value
End If
Loop While Not InvCell Is Nothing And InvCell.address <> Firstaddress
End If
End With


Cool.
Now, Paste all the information in ItemFound to some cells... Grab that information with a Userform. User Pick one of them. Lovely..
But now, I need "InvCell" to be assigned to the range of the item the user selected in the Form. I am bamboozeled(wtf?)

mdmackillop
10-21-2005, 11:34 AM
A userform example

russkie
10-27-2005, 07:12 AM
MD, this works cool, but i still have the situation, where i need to do a buncha maninpulations to those cells the user cooses. For example, user types in the code: 123. and in the userform chooses "Book1". So in my program lets say the user wants to change the code of the item, or change the item name. I need to call back the array ""IsFound" which contains the Range of the item for the specific copy of the item the user has selected and make changes to it.
What happens here the user has chosen "Book1" of 3 items that have the same code. I need the userform to send back to the macro the "location" of the item selected for further manipulation? Even if there is a way around send the range position back and forth from the macro to form, i still need it in that specific way, do you know how to do this?
Thanks alot.