Consulting

Results 1 to 6 of 6

Thread: Add extra step to current macro to reset table

  1. #1
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    294
    Location

    Add extra step to current macro to reset table

    See attached workbook
    Hi Experts

    i have been working on a clear contents macro that finally works fine, but how would i without make a complete pigs ears of the current macro add the following step.

    just need the current macro once the data has been cleared from the 3 table(s) rows below the word milestone in each table.

    to reset the number of empty/blank rows below the word milestone to five empty rows. Just that.


    [vba]Sub ClearData()
    Application.ScreenUpdating = False
    Dim rng As Range, Cell As Range

    Set rng = Range("A14:K" & Cells(65536, "B").End(xlUp).Row)
    For Each Cell In rng
    If (Range("B" & Cell.Row).Interior.ColorIndex = -4142 And Range("B" & Cell.Row).Font.Bold = False) Then
    Cell.ClearContents
    End If
    Next Cell

    Application.ScreenUpdating = True

    End Sub[/vba]

  2. #2
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    294
    Location
    any initial ideas?

  3. #3
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    294
    Location
    im guessing this cannot be done?

  4. #4
    VBAX Mentor MaximS's Avatar
    Joined
    Sep 2008
    Location
    Stoke-On-Trent
    Posts
    360
    Location
    Your goal is achievable but your post is not explaining the problem well.

    Can you please write what exactly you want to do with that macro?

    Is that just clearing the content of 3 tables in "Latin_America_Santander" Sheet just under word Milestiones?

    If yes then how many rows under that word? Is it variable or allways the same number of rows?

  5. #5
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Pete, please wrap your sections of code with the VBA button. See how much clearer it becomes as I've done this for you in your initial post.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  6. #6
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    here ya go
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •