Changing specific Listbox value

T

Todd Huttenstine

Hey

Below is code that populates a listbox using the RowSource property.

Counter = Worksheets("Market IDs All
Regions").Range("A65536").End(xlUp).Row

ListBox1.ColumnCount = 3
ListBox1.ColumnHeads = True
ListBox1.RowSource = Workbooks("B2B Master.xls").Worksheets("Market IDs
All Regions").Range("A2:D" & Counter).Address


Lets say I need to change the value of row 6 column 2... How would I
specify this?


Thanks
Todd Huttenstine
 
T

Tom Ogilvy

Your question is imprecise as to exactly what you are asking, but here is a
guess:

First change
ListBox1.RowSource = Workbooks("B2B Master.xls").Worksheets("Market IDs
All Regions").Range("A2:D" & Counter).Address
to

ListBox1.RowSource = Workbooks("B2B Master.xls").Worksheets("Market IDs
All Regions").Range("A2:D" & Counter).Address(external:=true)

then

set rng = Range(Listbox1.RowSource)
Listbox1.RowSource = ""
rng(6,2).Value = "Dubois"
Listbox1.rowSource = rng.Address(external:=True)
 
D

Dave Peterson

try this in a test sub:

with activesheet.range("a1")
msgbox .address & vblf & .address(external:=true)
end with

And you'll see.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top