Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Kerri Gonzalez   on Oct 27 In MS Office Category.

  
Question Answered By: Brandi Ramirez   on Oct 27

Yes, if the Current Period & Quarter To Date headings are in column  H, the macro
won't work as intended. Here is a revised version:

Sub Macro2()
Dim MT As Integer
Range("I3:M3").Select
Selection.Delete Shift:=xlUp
Range("H4").Activate
MT = 0
Do While MT < 10
If ActiveCell.Value = "Quarter To Date" Then
ActiveCell.EntireRow.Delete
MT = 0
ActiveCell.Offset(-1, 0).Activate
ElseIf Len(ActiveCell.Value) = 0 Then
ActiveCell.EntireRow.ClearContents
MT = MT + 1
End If
ActiveCell.Offset(1, 0).Activate
Loop
Columns("H:H").Select
Selection.Replace What:="Current Period", Replacement:="Quarter To Date", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=
_
False, ReplaceFormat:=False
Range("A1").Select
End Sub

Share: 

 

This Question has 10 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Delete Part of Row and move next Row Down Up Or get search suggestion and latest updates.


Tagged: