troubleshooting Question

Userform Textbox with date adjusted by worksheet cell

Avatar of wlwebb
wlwebbFlag for United States of America asked on
Microsoft Excel
5 Comments1 Solution306 ViewsLast Modified:
Hi
I have an Excel 2007 workbook where I have created a Userform.  On that Userform the clerk will select a date from a Calendar Control.  That selected date then populates textbox tbDateEnd with the following

(Note-This code works)
Private Sub Calendar1_Click()
    ActiveCell.NumberFormat = "m/d/yyyy"
    tbDateEnding.Value = Calendar1.Value
    Sheets("History Detail").Range("DateEndingInput").Value = Calendar1.Value
    
End Sub

This following is what I can't get to work

I have a second textbox where I want the deliver date to be calculated and recorded.  The deliver date lead time is a named range on worksheet "Company Data"  That name is "LeadTimeDaysAdjustment" and is a formula that returns a number (example say 7).

What I am trying to do is when the clerk clicks the calendar control it populates that tbDateEnding (which it currently does) and then populates the "tbDeliverDate" with the tbDateEnding + the LeadTimeDaysAdjustment

Here is the code I used for that:
Private Sub tbDateEnding_Change()
    DaysAdjust.Value = Worksheets("Company Data").Range("LeadTimeDaysAdjustment").Value
    ActiveCell.NumberFormat = "m/d/yyyy"
    
    tbDateEnding.Value = (tbDateEnding.Value + DaysAdjust.Value)
    
End Sub

It does not work.
ASKER CERTIFIED SOLUTION
NorieAnalyst Assistant
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros