• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

I need help with Vbe in Excel

hello, I am having trouble with my excel workbook - I want to add a date that updates but I don't want the time with it. Ama
 
Hi ,

To use the data alone , use the INT function ; thus suppose you have a date + time in cell A1 , such as :

22-12-2014 12:35:46 PM

using the INT function around this , as in :

=INT(A1)

will return :

22-12-2014

Narayan
 
Hi ,

To use the data alone , use the INT function ; thus suppose you have a date + time in cell A1 , such as :

22-12-2014 12:35:46 PM

using the INT function around this , as in :

=INT(A1)

will return :

22-12-2014

Narayan

Thank you Narayan
 
I am going to have to use code for the worksheet Summary because once the template is ready with the working buttons, the formula has a problem. The information has to be deleted, (data) used to test the worksheet. The buttons work with import of xls files and the combine works, and the formatting attached to the validate button but I need to add the code for the summary sheet. I am sorry.

summarysheet-png.13860


ama, ps. I got the date formula to work.
 

Attachments

  • National2.xlsm
    384 KB · Views: 2
Last edited:
hi Narayan, I am having trouble with the excel workbook, its with the Validate button. Attached. Ive included the excel files.
 

Attachments

  • National+excel files.zip
    489.7 KB · Views: 3
Hi Narayan, everything works with the excel file, thank you. I have a macro enabled Word Template, how do I get the flashing icon to start at the salutation DearFirstName in the Userform. Ive attached a copy of the document and code.
 

Attachments

  • UserFormCodeforDoc.PNG
    UserFormCodeforDoc.PNG
    75.1 KB · Views: 6
  • UserformDeFN.PNG
    UserformDeFN.PNG
    62.4 KB · Views: 5
Hi ,

Don't you need to have a UserForm.Show some where to display the form in the first place ?

Narayan[/quote

I had it in the code section for the Userform but it won't show, so I put it in the module but it still won't show. I will have to play around with it
 
Hi ,

It will help if you can upload the document ; you can always remove all its content , retaining only the userform and the code , and then upload it.

Otherwise , we will continue this back and forth dialogue for a long time.

Narayan
 
Sub Document_New()
'Procedure to show UserForm frmWelcomeAboardInput
'Written by Brandon 11/11/14
frmWelcomeAboardInput.Show
End Sub

Option Explicit
Sub cmdClose_Click()
'Procedure for button cmdClose
'Written by Brandon 14/11/14
End
End Sub

Sub cmdLog_Click()
'Procedure for button cmdLog
'Written by Brandon 14/11/14
Dim DateString, myPathAndFile As String
DateString = Format(Date, "Short Date")
myPathAndFile = ThisDocument.Path & "\Log.txt"
Open myPathAndFile For Append As #1
Write #1, DateString, txtDearFirstName.Value, txtFirstName.Value, txtLastName.Value, txtGender.Value, txtDateofBirth.Value, txtAddress.Value, txtSuburb.Value, txtState.Value, txtPostcode.Value, txtRole.Value
Close #1
End Sub

Sub cmdOK_Click()
'Procedure for click on button cmdOK
'Written Brandon 11/11/14
ActiveDocument.Bookmarks("DearFirstName").Range.Text = txtDearFirstName.Value
ActiveDocument.Bookmarks("FirstName").Range.Text = txtFirstName.Value
ActiveDocument.Bookmarks("LastName").Range.Text = txtLastName.Value
ActiveDocument.Bookmarks("Gender").Range.Text = txtGender.Value
ActiveDocument.Bookmarks("DateOfBirth").Range.Text = txtDateofBirth.Value
ActiveDocument.Bookmarks("Address").Range.Text = txtAddress.Value
ActiveDocument.Bookmarks("Suburb").Range.Text = txtSuburb.Value
ActiveDocument.Bookmarks("State").Range.Text = txtState.Value
ActiveDocument.Bookmarks("Postcode").Range.Text = txtPostcode.Value
ActiveDocument.Bookmarks("Role").Range.Text = txtRole.Value
frmWelcomeAboardInput.Hide
End Sub

Sub cmdClear_Click()
'Procedure for button Clear
'Written by Brandon 11/11/14
txtDearFirstName.Value = Null
txtFirstName.Value = Null
txtLastName.Value = Null
txtGender.Value = Null
txtDateofBirth.Value = Null
txtAddress.Value = Null
txtSuburb.Value = Null
txtState.Value = Null
txtPostcode.Value = Null
txtRole.Value = Null
End Sub
 

Attachments

  • Userformdocs.zip
    567.2 KB · Views: 5
Last edited:
Ok, I was able to upload the Userform file with the template. Its in a zip file.
 
Last edited:
Back
Top