Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I want vb to replace all dates 00.01.1900 (=0 in general) in a spreadsheet
with blank (""), but Find a d Replace don't find any occurences, even if there are so. -- ~roar |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
You can do this via number formatting: If you right-click on the cells and select Format Cells, on the number tab choose custom and use something like: dd.mm.yyyy;; Note the semi-colons on the end. Then any 00.01.1900 will be represented on the sheet as blanks. Hope this helps! Richard Roar wrote: I want vb to replace all dates 00.01.1900 (=0 in general) in a spreadsheet with blank (""), but Find a d Replace don't find any occurences, even if there are so. -- ~roar |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks, I tryed, but the purpose is to clear all cells with the date
00.01.1900. If these cells are not cleared/blank, the automatic print area setting is including these blank rows when printing. Appreciate you assistance. -- ~roar RichardSchollar skrev: Hi You can do this via number formatting: If you right-click on the cells and select Format Cells, on the number tab choose custom and use something like: dd.mm.yyyy;; Note the semi-colons on the end. Then any 00.01.1900 will be represented on the sheet as blanks. Hope this helps! Richard Roar wrote: I want vb to replace all dates 00.01.1900 (=0 in general) in a spreadsheet with blank (""), but Find a d Replace don't find any occurences, even if there are so. -- ~roar |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit Dim i As Long Dim iLastRow As Long With ActiveSheet iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row For i = 1 To iLastRow If IsDate(Replace(.Cells(i, TEST_COLUMN).Value, ".", "/")) Then .Cells(i, TEST_COLUMN).ClearContents End If Next i End With End Sub -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Roar" wrote in message ... Thanks, I tryed, but the purpose is to clear all cells with the date 00.01.1900. If these cells are not cleared/blank, the automatic print area setting is including these blank rows when printing. Appreciate you assistance. -- ~roar RichardSchollar skrev: Hi You can do this via number formatting: If you right-click on the cells and select Format Cells, on the number tab choose custom and use something like: dd.mm.yyyy;; Note the semi-colons on the end. Then any 00.01.1900 will be represented on the sheet as blanks. Hope this helps! Richard Roar wrote: I want vb to replace all dates 00.01.1900 (=0 in general) in a spreadsheet with blank (""), but Find a d Replace don't find any occurences, even if there are so. -- ~roar |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I think Bob misread your message. I understood it to be that you want the
zero date (not all dates) deleted. Here is a minor modification Public Sub ProcessData2() Const TEST_COLUMN As String = "A" '<=== change to suit Dim i As Long Dim iLastRow As Long With ActiveSheet iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row For i = 1 To iLastRow If IsDate(.Cells(i, TEST_COLUMN).Value) And .Cells(i, TEST_COLUMN).Value = 0 Then .Cells(i, TEST_COLUMN).ClearContents End If Next i End With End Sub best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert Automatic, Non-Updating Date Stamp | Excel Discussion (Misc queries) | |||
Need to Improve Code Copying/Pasting Between Workbooks | Excel Discussion (Misc queries) | |||
Another Date issue. | Excel Worksheet Functions | |||
NETWORKDAYS - Multiple Date Selection | Excel Discussion (Misc queries) | |||
How do I calculate if a date is in a certain time frame? | Excel Worksheet Functions |