Please HELP me!!

A

Alpineman2

I have created a userform and understand how to populate data from a single
textbox/combobox to an 'ActiveCell', however, can't figure out how to
populate data from the single textbox/combobox to an entire area that I've
selected/highlighted.
-By single textbox/combobox I mean one control to one column and/or multi
column.

Your help is much appreciated.
 
F

FSt1

hi
it's usually done one control at a time. avoid activecell.
Range("A1").value=textbox1.value
Range("A2").value=textbox2.value
Range("A3").value=textbox3.value
ect.

but this requires hard coding which may be unsuitable for all situations.
if your are creating a data base with your userform then you can use
variables.
dim a as range
dim b as range
dim c as range
'this line will take you to the first empty cell in column A
set a = range("A1").end(xldown).offset(1,0)
'set the other variables
Set b = a.offset(0, 1) 'same row, 1 column to right
Set c = a.offset(0, 2) 'same row, 2 columns to right
'fill the cells
a.value=textbox1.value
b.value=textbox2.value
c.value=textbox3.value

may seem like a round about way but you have to tell xl where to go without
knowing where it's going.

post back if you need more info.
regards
FSt1
 

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