View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 153
Default Deleting Rows based on text in cell & formatting cell based on text in column beside it

Sorry about the other coding. I hope this helps out

Sub DeletingRows(

Range("A1").Select 'Assumes the value used for deleting row is in column A
'change value to column where value is located

Do Until x = 10 'Change number for extra number of blanks between dat
caseText = ActiveCell.Valu
Select Case (caseText
Case Is = "Sub Total", "sub total" 'You can change to any value you wish to delet
Selection.EntireRow.Delet
y =
Case Is = "Total", "total" 'You can add as many Case is ="TEXT" line as neede
Selection.EntireRow.Delet
y =
Case Is = "" 'blank cell valu
Selection.EntireRow.Delet
y =
End Selec
If y = 1 The
Els
ActiveCell.Offset(1, 0).Selec
End I
If ActiveCell = "" The
x = x +
Els
x =
End I
y =
Loo

End Su
Sub ChangingCredit(

Dim credit As Strin

Range("B1").Select 'starting poin

Do Until x = 10 'Change number for extra number of blanks between dat
rng = ActiveCel
credit = ActiveCell.Offset(0, 1).Range("A1").Value 'assuming Cr right of numbe
If credit = "CR" Or credit = "cr" Or credit = "Cr" The
ActiveCell.Value = rng * -
End I
ActiveCell.Offset(1, 0).Selec
If ActiveCell = "" The
x = x +
Els
x =
End I
Loo
End Su