Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In this portion of my code, I get an runtime error IF e2 is blank. I
need this to be conditional. Therefore, if e2 is blank, avoid the autofill and keep going to next step in code... Do not give me the runtime error. With ThisWorkbook.Worksheets("2mindex") Set rngData = .Range("e2:e" & .Cells(.Rows.Count, "e").End (xlUp).Row) Set rngFormula = .Range("f2") rngFormula.AutoFill _ Destination:=.Range(rngFormula, _ .Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column)) End With |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
test this.modify to suit
Sub dontdoifblank() With ThisWorkbook.Worksheets("sheet4") If Not Len(Application.Trim(.Range("e2"))) < 1 Then Set rngData = .Range("e2:e" & .Cells(.Rows.Count, "e").End(xlUp).Row) Set rngFormula = .Range("f2") rngFormula.AutoFill _ Destination:=.Range(rngFormula, _ .Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column)) End If End With End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "J.W. Aldridge" wrote in message ... In this portion of my code, I get an runtime error IF e2 is blank. I need this to be conditional. Therefore, if e2 is blank, avoid the autofill and keep going to next step in code... Do not give me the runtime error. With ThisWorkbook.Worksheets("2mindex") Set rngData = .Range("e2:e" & .Cells(.Rows.Count, "e").End (xlUp).Row) Set rngFormula = .Range("f2") rngFormula.AutoFill _ Destination:=.Range(rngFormula, _ .Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column)) End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error code 1004 | Excel Worksheet Functions | |||
Runtime Error in code | Excel Programming | |||
VB Code + Runtime error 91 | Excel Programming | |||
RunTime Error 424 in a USERFORM's code | Excel Programming | |||
Repost with code - Runtime error '1004' | Excel Programming |