+ Reply to Thread
Results 1 to 8 of 8

Clear Contents in Specific Rows via condition

  1. #1
    Registered User
    Join Date
    02-05-2008
    Posts
    17

    Clear Contents in Specific Rows via condition

    Hi All,

    I am fairly new to Excel VBA coding. I have some programming background, but not enough to get through this task. I am sure its not that hard, but with my current code, I am stuck in a for loop.

    So here is my question:

    I have a workbook with about 30 worksheets and in each worksheet in column R there is data, either some text or the number "0". If there is a number "0" I need to clear the content from cells F3 to Q50. The content needs to be cleared for the range given for each each worksheet within the workbook. Can someone help me out with this VBA code?

    Thanks~ :)
    Last edited by Excel Newbie05; 02-05-2008 at 01:22 PM. Reason: Need to change Topic

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Please read the Forum Rules & use appropriate wording for your Thread Titles.

    It might help to post your existing code.

    Can the 0 be in any cell withi Column R?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    02-05-2008
    Posts
    17
    Hi RoyUk,

    Thank you for your reply and advice. I have changed the topic of my question. Hopefully this will help.

    The "0" will be in column R within the range of R3 to R50. It is at random, some of these cells will contain text and some of them will contain "0". All the cells that contain "0", I need to clear the content in the same cells row within the range of F3 to Q50.

    Example if Cell R5 contains a "0" I will need to clear the content in the cells range F5:Q5.

    I hope this makes sense~

    Thanks!
    Last edited by Excel Newbie05; 02-05-2008 at 01:44 PM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Thanks for co-operating. Do you want to empty those cells or delete the Row?

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    02-05-2008
    Posts
    17
    I would like to empty the cells, not delete the cells.

    Thanks! For all the help! This is great so far!

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this
    Edit: amended the code
    Please Login or Register  to view this content.
    Last edited by royUK; 02-05-2008 at 02:29 PM.

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    royUK,

    The reason Excel Newbie05 didn't respond was he cross posted it on JMT.

    Excel Newbie05,

    Please read forum rules and message to cross posters below and then add the link to the cross post

    VBA Noob

+ 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