0

I have four specific partial texts I require to separate from each other and then specify what they are on top, then provide a count and sum below. My current sub provides me with the first part. I have them separated and the header with font change, however I cannot find any method that works in application to my problem anywhere online and I need to count the (in this instance) number of items that contain "DPC" in column B and then next to this provide the sum total in the same row in column C.

Sub FontBoldItalicAndSumOnlineBankTransfers()

    Dim MyRange As Range
    Set MyRange = ActiveSheet.Range("A:N")
    MyRange.Find("DPC", LookIn:=xlValues).Select
    ActiveCell.Offset(RowOffset:=-1).Activate
    ActiveCell = "Online Bank Transfers": Selection.Font.FontStyle = "Bold Italic"
    NextFree = Range("B5:B" & Rows.Count).Cells.SpecialCells(xlCellTypeBlanks).Row
Range("B" & NextFree).Select


End Sub
Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
2beats
  • 1
  • 1
  • Welcome to SO! I've placed the description *above* the code, so that the question summary doesn't display as gibberish on the main page... however I'm not seeing an actual question in your post, can you further [edit] to clarify what the *specific* problem is? – Mathieu Guindon Dec 13 '16 at 15:45
  • `ActiveCell.Offset(RowOffset:=-1).Activate` - is that a way to do that? Do you mean perhaps `ActiveCell.Offset(-1,0).Activate`? But also, generally, you want to [avoid using `.Activate`/`.Select`](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba-macros) in your code. – BruceWayne Dec 13 '16 at 16:20

0 Answers0