PLEASE HELP: Index and Match function in Userform to populate fiel

D

Dave Peterson

Set up the output sheet first:

'at the top of the userform module
dim WksCreated as boolean

sub commandbutton1_click()
if wkscreated = false then
wksCreated = true
end if

with newwks
set destcell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with

with destcell
.value = me.textbox1.value
.offset(0,1).value = "next column over"
.offset(0,5).value = "5 columns to the right"
end with

End sub

Untested, uncompiled.



Then do the

Hey Dave, Rite now with this code it is saving seperate copies on clicking
"Insert"

I want to loop it through the same worksheet and save the data on the same
sheet but new row every time I hit "Insert"

SO when I click "Insert" after selecting a Task from the dropdown... I want
that Task and ROll no to populate in Row1, then If I input a different roll
no and select a Task for that and click "Insert" I want this to populate in
Row2 and so on.. Untill I manually save the workbook

Thanks in advance
 
S

sam

Hi Dave,

I am trying to get this thing to work but its not working as I want.

Lets say I have a button "Export" on the userform, This userform has a
dropdown menu, which has student names, and selecting a student name from
that dropdown would populate other fields on the form such as, Name, Age,
Task etc..
So if i select Student1 from the dropdown, I will get the data of Student1
displayed on the form, If i select Student2 from the dropdown, I will get
data of Student2 displayed on the form.
Now when I click export, I want it to:
- open a file dialog box that lets me select another empty excel file
- once i select the excel file, i want the details of the select student to
be displayed in Row1
-If i select another student from the dropdown, i want the details of that
student to be displayed in Row2... and so on..
- Once I am done selecting the students, I want to manualy save the excel
file where I exported the student data.

Is this possible?

Thanks in Advance
 
D

Dave Peterson

What does "select another empty excel file" mean?

I guessed that creating a new workbook with a single worksheet would be ok.

That's what this did:
 

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