Need help trying to get a form to submit fields in the correct place on a sheet

bobbyt

New Member
Joined
Jul 17, 2012
Messages
2
Hi All,

Just need a little help if possible please. I have a form with a number of fields that once submitted paste the data in the next blank row in a sheet (as below). A user will input the date of the week commencing in a text box on the form (Calendar1) and a number of days in another box (txtSupp). I need it to submit the value of "txtSupp" in the same row on the sheet under the right date of the week commencing based on date in "Calendar1". Rows L1 to EJ1 of the sheet have the date of the week commencing starting from 02/04/2012. E.g. L1 = 02/04/2012, M1 = 09/04/2012 etc.

Any help is really appreciated. Thanks in advanced!
Private Sub SubmitForm_Click()

ActiveWorkbook.Sheets("Data").Activate

Range("A1").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True

Application.ScreenUpdating = False

ActiveCell.Value = ListBox1.Value

ActiveCell.Offset(0, 1) = txtDate.Value

ActiveCell.Offset(0, 2) = ListBox2.Value

ActiveCell.Offset(0, 3) = txtDir.Value

ActiveCell.Offset(0, 4) = txtReqNo.Value

ActiveCell.Offset(0, 6) = ComboBox1.Value

ActiveCell.Offset(0, 7) = ComboBox2.Value

ActiveCell.Offset(0, 8) = ComboBox3.Value

ActiveCell.Offset(0, 9) = txtSign.Value

ActiveCell.Offset(0, 10) = txtSupp.Value

End Sub
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Sorry if any moderator could code my vba please as for some reason it won't let me edit my post? Think there is a problem my end? Thank you
 
Upvote 0

Forum statistics

Threads
1,216,163
Messages
6,129,223
Members
449,495
Latest member
janzablox

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