PDA

View Full Version : Add extra step to current macro to reset table



Pete
12-02-2008, 03:39 AM
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.


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

Pete
12-02-2008, 06:50 AM
any initial ideas?

Pete
12-03-2008, 12:40 AM
im guessing this cannot be done?

MaximS
12-03-2008, 01:31 PM
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?

Aussiebear
12-03-2008, 04:07 PM
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.

rbrhodes
12-05-2008, 05:44 PM
here ya go