+ Reply to Thread
Results 1 to 2 of 2

want to move content of cells somewhere else only if it's not a date format

  1. #1
    Registered User
    Join Date
    12-17-2012
    Location
    South Carolina
    MS-Off Ver
    Excel 2010
    Posts
    12

    want to move content of cells somewhere else only if it's not a date format

    I have a column of data that has a mix of dates and numbers. I want to create a macro that moves only the numbers (not dates) over a set distance (a few columns over and up one). I can play around with "offset" and get it right but am having trouble with getting the "NumberFormat" property to recognize what's in date format and what's not.

    I used the following simple code to get started:

    Please Login or Register  to view this content.
    It's moving everything regardless of format. I tried using m/d/yyyy instead of "Date" but that doesn't work either. Do I need to use an "elseif" somewhere too?

    Thanks.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner VA USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,426

    Re: want to move content of cells somewhere else only if it's not a date format

    I ran your code with m/d/yyyy and it worked perfectly. Check the formatting in the cells that you think are dates. If you have custom formatting you need to use the custom format string.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Move the content of specific groups of cells in column C to the first cell in that group
    By aviatecar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2014, 12:57 PM
  2. [SOLVED] I want macro to Move content when certain cells change and to run automatically.
    By Mysstownsend in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-18-2013, 07:34 PM
  3. Looking for Nested If Statement to move content of cells to new cell
    By sfadam in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-09-2013, 07:24 PM
  4. [SOLVED] How to automatically move Line(Shapes) based on cells content?
    By hmgrts in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-12-2013, 01:30 AM
  5. move cells based on partial-content.
    By jimmyyang in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2008, 02:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1