+ Reply to Thread
Results 1 to 10 of 10

Clear column C from 2 to 10 000 if (Excel 2003)

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Clear column C from 2 to 10 000 if (Excel 2003)

    I am having trouble modifying the following information code:

    Please Login or Register  to view this content.
    The code adds the information on an extra line if you add a number in Column C. I need it to clear the info after it has run the VB code from Column C2 to C10000.


    So instead of

    Please Login or Register  to view this content.
    It would be ???

    Please Login or Register  to view this content.

    Thank you for your time

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Clear column C from 2 to 10 000 if (Excel 2003)

    Range("C2:C10000").ClearContents
    Last edited by patel45; 07-20-2012 at 11:49 AM.

  3. #3
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Clear column C from 2 to 10 000 if (Excel 2003)

    Giving me a run time error

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Clear column C from 2 to 10 000 if (Excel 2003)

    excel 2003 limits:
    max rows 65.536
    max columns 256

  5. #5
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Clear column C from 2 to 10 000 if (Excel 2003)

    It adds the function but it will not clear afterwards.

    Runtime error "1004"

    I added the code right after the last "End With"

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Clear column C from 2 to 10 000 if (Excel 2003)

    excel 2003 limits:
    max rows 65.536
    max columns 256

  7. #7
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Clear column C from 2 to 10 000 if (Excel 2003)

    It's the rows I want to delete but in Column C

    So everything between C2 and C10000 I want it to clear after the code has run.

    Ex: if I add in Column C2 = 002 it will add a row, then offset the info then I need it to clear all of column C starting at row 2.

  8. #8
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Clear column C from 2 to 10 000 if (Excel 2003)

    Just a typo. Replace the ; with a : in patel45's code.

  9. #9
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Clear column C from 2 to 10 000 if (Excel 2003)

    Thanks StephenR, I updated

  10. #10
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Clear column C from 2 to 10 000 if (Excel 2003)

    You guys are life savers, works like a charm.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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