Coding for Combo Box to copy value as text to next empty cell in sheet2

nadrian

New Member
Joined
Nov 29, 2016
Messages
21
Hi,

I am new here and I would like to have data from 6 combo boxes (Text) only to second sheet for record. I have linked cells to combo boxes but its not saving value to next available cell. There text fields as well which works fine when I click on Submit button.


Please help

Code:
===================================================
Private Sub CommandButton1_Click()



Range("C10").Copy Destination:=Worksheets("Record").Cells(Worksheets("Record").Rows.Count, "B").End(xlUp).Offset(1, 0)


Range("C11").Copy Destination:=Worksheets("Record").Cells(Worksheets("Record").Rows.Count, "C").End(xlUp).Offset(1, 0)


Range("C12").Copy Destination:=Worksheets("Record").Cells(Worksheets("Record").Rows.Count, "D").End(xlUp).Offset(1, 0)


Range("C13").Copy Destination:=Worksheets("Record").Cells(Worksheets("Record").Rows.Count, "E").End(xlUp).Offset(1, 0)


Range("C14").Copy Destination:=Worksheets("Record").Cells(Worksheets("Record").Rows.Count, "F").End(xlUp).Offset(1, 0)


Range("C15").Copy Destination:=Worksheets("Record").Cells(Worksheets("Record").Rows.Count, "G").End(xlUp).Offset(1, 0)


Range("C16").Copy Destination:=Worksheets("Record").Cells(Worksheets("Record").Rows.Count, "H").End(xlUp).Offset(1, 0)


Range("C19").Copy Destination:=Worksheets("Record").Cells(Worksheets("Record").Rows.Count, "K").End(xlUp).Offset(1, 0)


Range("C22").Copy Destination:=Worksheets("Record").Cells(Worksheets("Record").Rows.Count, "N").End(xlUp).Offset(1, 0)






Range("C10").Value = ""
Range("C11").Value = ""
Range("C12").Value = ""
Range("C13").Value = ""
Range("C14").Value = ""
Range("C15").Value = ""
Range("C16").Value = ""
Range("C19").Value = ""
Range("C22").Value = ""




End Sub
==============================
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
When I enter your script into a submit button it works for me.
Are you wanting this to happen when you enter a value into the Combobox or when you press a submit button?
 
Upvote 0
Thanks for reply....it only copy data once for combo box. I need to copy data again in next empty cell upon submit.
 
Upvote 0
Normally a Combobox is initially loaded with values. And then as users select values in the combobox the value selected will then be entered into another cell or sheet.

The Combobox would not need to be linked to a cell. Linking the combobox to a cell will not work for what you want. As far as I know.

The Combobox would then have a script installed telling the combobox what to do when a item in the list is selected.
Explain more what your attempting to do and maybe I can help you.
 
Upvote 0
You did not answer my question.

"Are you wanting this to happen when you enter a value into the Combobox or when you press a submit button?"
 
Upvote 0
And as I previously mentioned when I run the script you supplied it adds the values to the next empty cell as you want.
 
Upvote 0
Thank you for reply. You are right i want exactly what you said. I want user in our local network fill this form and submit; it should save data into next empty cell. At the moment it only copy data from tables into next empty cell when I submit but combo box repeatedly save it to first cell.
Kindly help me code for combo box to save value into. Sheet2 empty cell.

Thanks in advance
 
Upvote 0
When you say:

local network fill this form and submit

What is a "Form"

Do you mean a "UserForm"
 
Upvote 0
This excel sheet will be shared on intranet and user will be filling it personal detail and in tables and choice from dropdown (combo box) with submit button. Data need to be saved in sheet2 according.

Thanks
 
Upvote 0
Apologies for late reply, its was late night in Australia,

I am attaching screen shot herewith for clear picture of what I want. Fist image is tables in excel where combo boxes are also added. Tables data successfuly copies data to Sheet2 but combo box repeats copying data to linked cell only. I need combo box copy value to next empty cell.

Thanks for time


HOW TO ADD IMAGE HERE?



You did not answer my question.

"Are you wanting this to happen when you enter a value into the Combobox or when you press a submit button?"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,443
Members
448,898
Latest member
drewmorgan128

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top