LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default range as listbox column

Hi All,

Can't figure out how to use a column of data from a listbox as a range.

Hope you can provide some advice.

I have an inventory database (wkbk), each item has a primary key, person,
office, sn etc... A userform is used to transfer equipment from a
person/office to another.
A listbox is used to list the items for transfer, the second column of the
lstbx holds the "primary key" value. By matching the primary key of the lstbx
to the primary key of the ws, I wish to update/append that particular row
with data found in 3 comboboxes (new person, office, etc).

This is what I have so far. The error I receive is "Error: 381: Could not
get the column property. Invalid property array index." (rng =
lst_map_trans_to.Column(2))

Dim i As Long
Dim ws As Worksheet
Set ws = Worksheets("Inventory")

For i = 0 To Me.lst_map_trans_to.ListCount - 1
Dim prkey As Variant
prkey = (lst_map_trans_to.List(i, 1) - 1)
Dim rng As Range
rng = lst_map_trans_to.Column(2)
For Each prkey In rng
Worksheets("mp").Range("j" & prkey) = cbx_map_office_to.Value
Worksheets("mp").Range("k" & prkey) = cbx_map_person_to.Value
Worksheets("mp").Range("l" & prkey) = cbx_map_loc_to.Value
Next
Next

Thanks for any and all advice.
 
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
Listbox Select Last Value in range Corey Excel Programming 3 May 14th 07 04:01 AM
populate 2 column listbox from one named range Jacob Excel Programming 4 November 5th 06 02:51 AM
range name as rowsource of listbox? Stefi Excel Programming 2 January 18th 06 01:26 PM
filling a two column listbox from a two column recordset Dennis Excel Programming 5 May 23rd 04 10:13 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


All times are GMT +1. The time now is 12:06 PM.

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

About Us

"It's about Microsoft Excel"