+ Reply to Thread
Results 1 to 5 of 5

VB code to delete value in a cell based on finding another Value

  1. #1
    Registered User
    Join Date
    08-21-2014
    Location
    virginia
    MS-Off Ver
    2010
    Posts
    7

    VB code to delete value in a cell based on finding another Value

    Hello,

    I would like to remove(delete) the value in one of the cell in the report but first I need to find the row which has "TOTAL" and in the same row in column "G" cell value should be deleted. The row number in which "TOTAL" value can vary based on number of accounts in the report ...so it may vary so I cannot hard code Row #. See example below. Row #131 has column C has TOTAL and Cell of 131 row and column G which has 102% should be deleted. I need a VB code for this.

    column B C D E F G
    131 TOTAL 0.00 0.00 0.00 102 %

    Thanks and appreciate in advance

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VB code to delete value in a cell based on finding another Value

    Range("G" & worksheetfunction.match("TOTAL",columns(3),0)).clearcontents

  3. #3
    Registered User
    Join Date
    08-21-2014
    Location
    virginia
    MS-Off Ver
    2010
    Posts
    7

    Re: VB code to delete value in a cell based on finding another Value

    Thanks!! it worked. You are so fast!!!

    Sorry, I just now realized that there is another row in the middle of the Report has value Total as well. So I want to make sure this TOTAL is the last row in the Column C .

    I will add Reputation and mark solved once I get your response. Thanks again for your help.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VB code to delete value in a cell based on finding another Value

    Maybe something like:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-21-2014
    Location
    virginia
    MS-Off Ver
    2010
    Posts
    7

    Re: VB code to delete value in a cell based on finding another Value

    Great! Your are awesome...Now I feel confident that I am looking the last row ONLY.

    Marking as solved.

+ 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. VBA code to delete row based on date i
    By anfdrew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2014, 09:23 PM
  2. [SOLVED] VBA Code to Delete a Column Based on a Condition
    By dosbirn in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-25-2013, 04:27 PM
  3. VBA code to find and delete cell contents based on userform combobox selections
    By anfdrew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2013, 04:13 PM
  4. Code to delete rows based on status code in Column I
    By LemonTwist in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2009, 07:01 PM
  5. [SOLVED] delete from : to n rows after finding data in a cell
    By George in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2006, 09:10 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