+ Reply to Thread
Results 1 to 5 of 5

loop for date value

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    loop for date value

    Hi,
    I am currently using the below code to change the text value in columns A, N, Q, R to date and then convert to date using the date value function. I am a bit of an amature @ this but it keeps showing an error @ the start of the first loop "For Each c In ActiveSheet.UsedRange.Columns("A").Cells" stating Runtime error 13 "Type Mismatch", Can anyone help me out with this?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: loop for date value

    I would suggest to use
    Please Login or Register  to view this content.
    and then to declare variable cell
    The error in my code is coming from statement "DateValue"
    Attached Files Attached Files
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    Re: loop for date value

    Sorry PCI I dont understand what you mean by declaring the variable cell?

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: loop for date value

    Maybe?:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: loop for date value

    Put the "Option Explicit" at the beginning of your code and launch the debug.
    It will stops at statement "IsNumeric(cell)" where the variable "cell" is not define
    In my code I changed cell by c as I was supposing it was the variable to use

+ 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] VBA to loop through and delete all date except Yesterdays date.
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-09-2014, 11:30 AM
  2. do untill loop add one day to the starting date till it equals the end date
    By lazybone in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2013, 04:09 AM
  3. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  4. For Loop + Date
    By jhensler01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-21-2011, 04:50 PM
  5. Replies: 0
    Last Post: 07-20-2010, 11:42 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