Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8118853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:37:22+00:00 2026-06-06T04:37:22+00:00

Issue Garbage gets erroneously entered into date fields and screws up calculations. Goal Using

  • 0

Issue

Garbage gets erroneously entered into date fields and screws up calculations.

Goal

Using a macro or function to check the contents in a range of cells, determine if they are dates and if not, delete the non-date contents.

What I’ve Tried

Using Search and Replace function to locate and delete offending items. Takes forever and still doesn’t clear everything out.

Any ideas, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:37:23+00:00Added an answer on June 6, 2026 at 4:37 am

    You could try this

    Sub DeleteNonDates()
        Dim r As Range, a As Range, cl As Range
        Set r = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants)
        For Each cl In r.Cells
            If TypeName(cl.Value) <> "Date" Then
                cl.ClearContents
            End If
        Next
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into this issue on accident while debugging a faulty string trim function
I came across a weird issue when using JVM garbage collection log option with
Issue: RODBC (falsely) returning zero rows Situation: I'm using RODBC to connect to a
Issue Using the following just simply doesn't work properly in -webkit- and -moz- browsers:
Issue - We have a spreadsheet with thousands of addresses but no counties. Goal
I am looking into the various options around garbage collection on a Java 6
I am updating our iPhone app to iOs4 and I ran into an issue
My developers and I are having an issue with objects being garbage collected in
I ran into this issue quite a few times. Let's say I have a
I have encountered strange issue with lists in F#. I am using XamlXmlReader to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.