VBA Userform no longer populating cells in spreadsheet?

Claire Jackson

Board Regular
Joined
Jun 30, 2020
Messages
74
Office Version
  1. 2016
Platform
  1. Windows
I had an excel workbook which had a userform in it which was working perfectly until I pointed to a new datafile. Now everything works ie bringing static data into the form but it's not populating the cells back into the excel workbook? I've attached both files for you to check what I'm doing wrong..

This is the code:
Code:
Private Sub Cmd_Access_Click()

Dim Job_Name As Variant
Dim Cur_Comp As Date
Dim ws As Worksheet
Dim What_Stage As String

Set ws = Worksheets("Sheet1")
With ws
.Range("B15").Value = Txt_Rev_Comp_Date.Text
.Range("B17").Value = Txt_Delay_Reason.Text
.Range("B19").Value = Txt_Cur_Percentage.Text
.Range("A23").Value = Txt_Job_Update.Text
.Range("A33").Value = Txt_Asbestos.Text
.Range("A37").Value = Txt_HS_Issues.Text
.Range("A41").Value = Txt_Security.Text
.Range("A47").Value = Txt_Further_Info.Text
.Range("A51").Value = Txt_Complaint.Text
.Range("H1").Value = Txt_Job_Ref.Text
 
Last edited by a moderator:
This is the file it reads from (Link to file remove by moderator)

The data in weekly job updates up to cell H13 are populated from this file. All cells beneath row 13 are populated from the userform.
 
Last edited by a moderator:
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
OK I've found the problem. Basically once the userform gets the data added if the user clicks on the validate data again it then populates the form Not sure why it doesn’t populate when only the Save & Email button is pressed.

Just not sure how to rectify it now..
 
Upvote 0
Glad to see you are getting on to the right path...
The code behind "PDF & EMAIL" button only create a Pdf and prepare the email with that pdf attached. It does nothing to populate Sheets1 cells

I think you should refocus how the form was designed and how the workprocess copes with it

Bye
 
Upvote 0
@Claire Jackson
I have removed the link to your file in post#11 as it contains personal information.
In future please ensure all data is sanitised before posting to the board.
Thanks
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,613
Members
449,090
Latest member
vivek chauhan

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