Form Code

Onicat

New Member
Joined
Feb 16, 2019
Messages
11
Good Day,
I have been working on this vb code based off some of your code, for building fillible forms. We are having an issue with the Private Sub SaveClient_Click Subroutine. The reason I changed the cell numbers, is to move them to the starting location on our workbook. as we want to have the data add a new row starting at C9, and just adding new clients as we get them.


Any help would be great.
Thanks - Lost Coder


Private Sub SaveClient_Click()
'Copy input values to sheet.
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(9, 3).Value = Me.SDSID.Value
.Cells(9, 4).Value = Me.LastName.Value
.Cells(9, 5).Value = Me.FirstName.Value
.Cells(9, 6).Value = Me.Harmony.Value
.Cells(9, 7).Value = Me.StreetAddress.Value
.Cells(9, 8).Value = Me.City.Value
.Cells(9, 9).Value = Me.State.Value
.Cells(9, 10).Value = Me.Zip.Value
.Cells(9, 11).Value = Me.DOB.Value
.Cells(9, 12).Value = Me.Gender.Value
.Cells(9, 13).Value = Me.Mediciad.Value
.Cells(9, 14).Value = Me.BillingStatus.Value
End With



End Sub
 
You're welcome & thanks for the feedback.
You didn't have a sheet called "Sheet1", but I don't understand why you didn't get any errors.
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
You're welcome & thanks for the feedback.
You didn't have a sheet called "Sheet1", but I don't understand why you didn't get any errors.

I think I see what happened. When I put the code in the full workbook, it appears that there was a "Sheet1" in there, just well hidden in all the other sheets.
When I found that I found that Data I was telling it to input. I like your code better because it works on the Active worksheet, witch is exactly what I was looking for.
Thank you very much :)
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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