Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using this code to put the value of EPLCRef1TextBox & "-"
EPLCRef2TextBox into the next empty cell in column "C" starting at Ro 10. Private Sub AuditDetailsCompleteCommandButton_Click() With Worksheets("DUMP") Application.ScreenUpdating = False Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Select If Selection.Row < 10 Then Range("A10").Select ActiveCell.Value = EPLCRef1TextBox & "-" & EPLCRef2TextBox End With Application.ScreenUpdating = True End Sub I then want to add the contents of UseThis1TextBox to the next cell o the Right and todays Date into the cell next to that. I also want to ad a few more TextBox Values to the right of this. Can someone please tell me how to do this in VBA. Cheer -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Select
If Selection.Row < 10 Then Range("A10").Select ActiveCell.Value = EPLCRef1TextBox & "-" & EPLCRef2TextBox End With ActiveCell.Offset(0,1).Value = UseThis1TextBox.Text ActiveCell.Offset(0,2).Value = Date Application.ScreenUpdating = True End Sub -- Regards, Tom Ogilvy "Jako " wrote in message ... I am using this code to put the value of EPLCRef1TextBox & "-" & EPLCRef2TextBox into the next empty cell in column "C" starting at Row 10. Private Sub AuditDetailsCompleteCommandButton_Click() With Worksheets("DUMP") Application.ScreenUpdating = False Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Select If Selection.Row < 10 Then Range("A10").Select ActiveCell.Value = EPLCRef1TextBox & "-" & EPLCRef2TextBox End With Application.ScreenUpdating = True End Sub I then want to add the contents of UseThis1TextBox to the next cell on the Right and todays Date into the cell next to that. I also want to add a few more TextBox Values to the right of this. Can someone please tell me how to do this in VBA. Cheers --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom , Only trouble is that the date is mm/dd/yy.
So todays date read 08/01/04, what i want it to read is 01/07/2004. I have tried =format(date, "dd/mm/yyyy" but to no avail, Excel seem to insist that i use mm-dd-yy !! Any ideas -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
DOH !! sorry of course i meant 01/08/2004 not 01/07/2004.
Cheer -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Select
If Selection.Row < 10 Then Range("A10").Select ActiveCell.Value = EPLCRef1TextBox & "-" & EPLCRef2TextBox End With ActiveCell.Offset(0,1).Value = UseThis1TextBox.Text ActiveCell.Offset(0,2).Value = Date ActiveCell.Offset(0,2).NumberFormat = "dd/mm/yyyy" Application.ScreenUpdating = True End Sub -- Regards, Tom Ogilvy "Jako " wrote in message ... DOH !! sorry of course i meant 01/08/2004 not 01/07/2004. Cheers --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
After you populate the cell, give it the numberformat you want:
ActiveCell.Offset(0,2).Value = Date ActiveCell.Offset(0,2).numberformat = "dd/mm/yyyy" or with ActiveCell.Offset(0,2) .Value = Date .numberformat = "dd/mm/yyyy" end with (to save your fingers) "Jako <" wrote: Thanks Tom , Only trouble is that the date is mm/dd/yy. So todays date read 08/01/04, what i want it to read is 01/07/2004. I have tried =format(date, "dd/mm/yyyy" but to no avail, Excel seems to insist that i use mm-dd-yy !! Any ideas? --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worked a treat Tom !!
Many thanks (and to Dave also -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populating Cells | Excel Discussion (Misc queries) | |||
Randomly populating empty cells with other text cells | Excel Discussion (Misc queries) | |||
Populating Cells from One Worksheet to Another... | Excel Worksheet Functions | |||
Populating several cells | Excel Worksheet Functions | |||
Populating cells | Excel Programming |