Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Replace date 00.01.1900

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 196
Default Replace date 00.01.1900

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Replace date 00.01.1900

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default Replace date 00.01.1900

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Replace date 00.01.1900

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Automatic, Non-Updating Date Stamp Ken Zenachon Excel Discussion (Misc queries) 8 January 18th 06 06:52 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Another Date issue. TimM Excel Worksheet Functions 1 November 17th 05 01:58 AM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
How do I calculate if a date is in a certain time frame? Pe66les Excel Worksheet Functions 19 August 27th 05 11:07 PM


All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"