C
Celt
TIA for any help offered. (I know I post a ton of questions here, but I
am learning a lot thanks to all the great advice!!)
I am trying to set 4 ranges. With my limited experience, it looks like
the coding below should work OK. However, when I test the macro to make
sure everything I have written so far works, I get an "Application
defined or object defined error" and the editor highlights the "Set
rngBS1" statement.
I have to be missing something..... I just don't know what it is.
here is the beginning of my code...
Option Explicit
Sub BlankNums()
Dim rngBS1 As Range, rngBS2 As Range, rngBS3 As Range, rngBS4 As Range
Dim rng1 As Range, rng2 As Range, rng3 As Range
Dim irow As Integer, jrow As Integer
With Worksheets("Budget Summary")
ActiveSheet.UsedRange
Set rngBS1 = .Range(.Cells(3, 3), .Cells(3,
Columns.Count).End(xlLeft))
Set rngBS2 = .Cells(4, 2)
Application.FindFormat.Interior.ColorIndex = 6
With Application.FindFormat.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Set rngBS3 = Cells.Find(What:="", After:=rngBS2, LookIn:=xlFormulas,
LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=True)
Application.FindFormat.Clear
irow = rngBS3.Row
Set rngBS4 = .Range(.Cells(irow, 3), .Cells(irow,
Columns.Count).End(xlLeft))
End With
am learning a lot thanks to all the great advice!!)
I am trying to set 4 ranges. With my limited experience, it looks like
the coding below should work OK. However, when I test the macro to make
sure everything I have written so far works, I get an "Application
defined or object defined error" and the editor highlights the "Set
rngBS1" statement.
I have to be missing something..... I just don't know what it is.
here is the beginning of my code...
Option Explicit
Sub BlankNums()
Dim rngBS1 As Range, rngBS2 As Range, rngBS3 As Range, rngBS4 As Range
Dim rng1 As Range, rng2 As Range, rng3 As Range
Dim irow As Integer, jrow As Integer
With Worksheets("Budget Summary")
ActiveSheet.UsedRange
Set rngBS1 = .Range(.Cells(3, 3), .Cells(3,
Columns.Count).End(xlLeft))
Set rngBS2 = .Cells(4, 2)
Application.FindFormat.Interior.ColorIndex = 6
With Application.FindFormat.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Set rngBS3 = Cells.Find(What:="", After:=rngBS2, LookIn:=xlFormulas,
LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=True)
Application.FindFormat.Clear
irow = rngBS3.Row
Set rngBS4 = .Range(.Cells(irow, 3), .Cells(irow,
Columns.Count).End(xlLeft))
End With