Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All:
Trying to edit a cell in Excel 2003 using Microsoft Visual Basic. I have a cell in "F4" "=now()" I have copied this cell "F4" Then "Paste special/Paste - values" into same cell Which results in say for example "7/9/2006 11:15:00 AM" Now I'm tryin to write a macro to automatically remove the " 11:15:00 AM" from the end. Macro so far is Range("F4").Select 'Selects the F4 cell ActiveCell.X 'What is the command to put where the X is? Thanks in advance for any help. Cheers Sharpy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sharpy,
Try: '============= Public Sub Tester001() With Range("F4") .NumberFormat = "dd/mm/yy" .Value = Date End With End Sub '<<============= -- --- Regards, Norman "Sharpy" wrote in message ... Hi All: Trying to edit a cell in Excel 2003 using Microsoft Visual Basic. I have a cell in "F4" "=now()" I have copied this cell "F4" Then "Paste special/Paste - values" into same cell Which results in say for example "7/9/2006 11:15:00 AM" Now I'm tryin to write a macro to automatically remove the " 11:15:00 AM" from the end. Macro so far is Range("F4").Select 'Selects the F4 cell ActiveCell.X 'What is the command to put where the X is? Thanks in advance for any help. Cheers Sharpy |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=now() will always give you the date AND time.
=today() will just give you the date. susan Norman Jones wrote: Hi Sharpy, Try: '============= Public Sub Tester001() With Range("F4") .NumberFormat = "dd/mm/yy" .Value = Date End With End Sub '<<============= -- --- Regards, Norman "Sharpy" wrote in message ... Hi All: Trying to edit a cell in Excel 2003 using Microsoft Visual Basic. I have a cell in "F4" "=now()" I have copied this cell "F4" Then "Paste special/Paste - values" into same cell Which results in say for example "7/9/2006 11:15:00 AM" Now I'm tryin to write a macro to automatically remove the " 11:15:00 AM" from the end. Macro so far is Range("F4").Select 'Selects the F4 cell ActiveCell.X 'What is the command to put where the X is? Thanks in advance for any help. Cheers Sharpy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Microsoft Visual Basic errors displaid when opening Microsoft Word 97 & Excel (7 | Setting up and Configuration of Excel | |||
Microsoft Visual Basic | Excel Programming | |||
converting formulas into values using a macro in visual basic edit | Excel Programming | |||
When you edit a macro in visual basic editor, why doesn't it upda. | Excel Programming | |||
microsoft visual basic | Excel Programming |