+ Reply to Thread
Results 1 to 2 of 2

If condition is satisfied don't do the while

  1. #1
    Registered User
    Join Date
    02-04-2021
    Location
    Brazil
    MS-Off Ver
    2016
    Posts
    3

    Question If condition is satisfied don't do the while

    Good afternon,

    I'm doing a macro to separate datas from matrix by the name in the first column "A";
    The macro get all the results in column A, paste in column Z and delete the duplicates values.

    I get "linha" = Z1 and I put to run line by line until the column z is ended.
    While the code is running, the macro creates a new sheet with the name that was in the column Z.

    For the first run, its work perfectly but in the second time I get an error because I don't need a new fresh table if i already have one.I just need to update the values in the existents sheets.

    Can someone help me with this?

    I'm sending the sheets with anex and the code in anex.

    Thanks a lot, Luiz.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    12-08-2020
    Location
    South Korea
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: If condition is satisfied don't do the while

    because if the sheet already exist then get error
    so you should check first sheet existed

    sample code below
    Please Login or Register  to view this content.

+ 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. Extract Values If Condition is Satisfied
    By bjnockle in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-11-2021, 04:40 AM
  2. If condition satisfied but ignored
    By remkin76 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2019, 12:58 AM
  3. Replies: 7
    Last Post: 06-01-2015, 06:05 PM
  4. Extract values if condition is satisfied
    By bjnockle in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-26-2014, 08:39 AM
  5. Replies: 8
    Last Post: 05-06-2011, 08:25 AM
  6. Lock Cell/s if condition satisfied.
    By cminoza in forum Excel General
    Replies: 1
    Last Post: 10-07-2009, 09:21 AM
  7. Replies: 0
    Last Post: 01-11-2006, 07:31 AM

Tags for this Thread

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