Hi all,
I'm trying to write a code that checks to see whether a cell is the same as the one above it, and if not, performs several actions. I've been trying to learn VBA from an Excel guide but it only has one relating chapter and after about 15 google searches, I decided to look for help here again.
Here's what I have right now:
It gives me an error at the "If cell.Value" line -- that's the part I can't figure out. How do I get it to compare the value of each cell to the one above it?
Thanks so much.
I'm trying to write a code that checks to see whether a cell is the same as the one above it, and if not, performs several actions. I've been trying to learn VBA from an Excel guide but it only has one relating chapter and after about 15 google searches, I decided to look for help here again.
Here's what I have right now:
Code:
Sub FormatRegions()
For Each cell In Worksheets("Rough Draft").Range("C:C")
If cell.Value <> Offset(-1, 0).Value Then
cell.Font.Bold = True
cell.FontSize 0.16 = True
EntireRow.Insert
EntireRow.Insert
End If
Next cell
End Sub
It gives me an error at the "If cell.Value" line -- that's the part I can't figure out. How do I get it to compare the value of each cell to the one above it?
Thanks so much.