Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi:
I am suddenly getting errors from my code in segments that have worked completely fine since I created it. Now, after adding code at the end of the macro to format my report, I am getting errors that were never there before. It seems to be rejecting a range assignment SrcHdrRng, but it resolves when I set the active cell to A1. Why does this happen? Dim SrcHdrRng as Range Dim MyCell as Range Set SrcHdrRng = Range("A1:" & (ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Address)) Set MyCell = SrcHdrRng.Find(What:="FirstName", _ After:=ActiveCell, LookIn:=xlFormulas, _ Lookat:=xlPart, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False).EntireColumn As well, I am getting an error 1004 on the following code when I try to set the Borders(xlInsideVertical) for the range. Any help is greatly appreciated. With Range("A5:" & (ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Address) & DestLast) With .Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThick .ColorIndex = xlAutomatic End With With .Borders(xlInsideHorizontal) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With .Borders(xlEdgeBottom) .LineStyle = xlDouble .Weight = xlThick .ColorIndex = xlAutomatic End With With .Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With .Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Error handling error # 1004 Run-time error | Excel Programming | |||
Run Time 1004 Error: Application or Object Difine Error | Excel Programming | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming |