Using "After Update

Denny57

Active Member
Joined
Nov 23, 2015
Messages
257
Office Version
  1. 365
Platform
  1. Windows
I am having some issues with a sub routine which I am hoping will update a number of User Form controls once a value is added to another control.

In thre attttached file I have "commented out" the sub-routine. I would welcome any assistance with the correct Syntax.

I would also appreciate some assitance with the final line in the penultimate sub-routine which requires a VLookup that does not want to function.

Many thanks

 
I have managed to get the following VLookup code to finally be accepted, however the control shows the numeric date value. How might I get this to display the visible date in the worksheet. Thanks again
 
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".
Being in Australia I'm not 100% sure if what I'm dealing with is regional issues, but from what I can tell the issue arises because the values in column M are text, as a result of the pound symbol formatting.
For example, if you put the formula
Excel Formula:
=ISTEXT(M2)
in N2 it returns true, so your SUMIFS in the code returns zero from summing text.

The solution is to make the values in column M plain numbers, in which case it works for me.

The problem with this part of the code:
VBA Code:
Dim x As Double, y As Double
    x = txtGrossPayWork.Value
    y = txtGrossPayLeave.Value

    txtTotalGrossPay.Value = Format(x + y, "Currency")
as before, is that txtGrossPayWork is a text control and txtGrossPayWork.value is text, so you cannot declare x as double and then assign it directly to the value of txtGrossPayWork. You have to convert it to double, like so:
VBA Code:
x=CDbl(txtGrossPayWork.Value)
Refer my previous code for the same variable at post #2 in this thread.
 
Upvote 0
I have now resolved the VLookup issue.

I just cannot understand why the SUMIFS are not totalling for the
Thank you. I have manually changed the format of the details in Columns L & M to numeric and the correct details are now visible. I just need to change the code to upload numeric values for these columns
 
Upvote 0
Denny57,

Please Note: In the future, when marking a post as the solution, please mark the post that contains the solution (not your own post acknowledging that some other post was the solution, or a post saying that you solved it, but did not include the solution in the post). Any post marked as the solution MUST actually contain the solution.

When a post is marked as the solution, it is then shown right underneath the original question so people viewing the question can easily see the question and solution in a single quick glance without having to hunt through all the posts.
 
Upvote 0

Forum statistics

Threads
1,226,452
Messages
6,191,127
Members
453,641
Latest member
enfkkviesm

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