+ Reply to Thread
Results 1 to 6 of 6

#N/A clear by For n ... next n

  1. #1
    Registered User
    Join Date
    02-21-2016
    Location
    PL
    MS-Off Ver
    2010
    Posts
    11

    #N/A clear by For n ... next n

    Hi All,
    In my sheet with data I have for each of six columns about 50 000 records per column. For most of cells (95%) cells.text = #N/A. I want to clear cells when cells.text = #N/A. For rest of them I input for each of columns correct value.
    For each of column I have separate For n … next n. What is more in turn off the Screen Updating to make the process faster.
    My question is. Is there any chance to make the code faster? Maybe you have a proposal for my how to make the process faster?
    Many thanks in advance.
    Regards,
    Maciej

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: #N/A clear by For n ... next n

    I wouldn't think you need to loop for such a specific need. I presume these cells are full of formulas?

    Please Login or Register  to view this content.
    If those aren't formulas then xlConstants.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-21-2016
    Location
    PL
    MS-Off Ver
    2010
    Posts
    11

    Re: #N/A clear by For n ... next n

    Excellent idea. I have not known syntax so far.
    This is great improvement. Do you have another brilliant idea for me. How to speed up the process with inputting different value for each columns?

    Many thanks in advance!

    Please Login or Register  to view this content.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: #N/A clear by For n ... next n

    Do some reading up on the SpecialCells options.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-21-2016
    Location
    PL
    MS-Off Ver
    2010
    Posts
    11

    Re: #N/A clear by For n ... next n

    By the way...
    If I use
    Please Login or Register  to view this content.
    Is the code correct (for me it works)? Could I use it instead
    Please Login or Register  to view this content.
    Could I expect that those two examples will give me the same results?

    Many thanks in advance

    Regards,
    Maciej

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: #N/A clear by For n ... next n

    Except that you took out the On Error Resume Next, be sure to include that above your one-liner.

+ 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. Clear merged cell contents in comand button(clear all)
    By mohan_984 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-25-2015, 10:39 AM
  2. On Close Clear ComboBox1 - ListIndex -1 and Clear not working
    By Janc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2015, 10:10 AM
  3. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  4. [SOLVED] can someone help modify the clear command to only clear columns from A-G?
    By psunursingguy21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2013, 03:52 PM
  5. [SOLVED] clear userform does not clear all boxes
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-23-2013, 11:43 AM
  6. [SOLVED] Clear button, add warning dialogue box that asks: Are you sure you want to clear?
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-21-2012, 02:41 PM
  7. Button to clear sheet and automatic clear rows
    By sandbach in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-29-2010, 02:06 PM

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