M
Manasses
Hello, I am using VBA in Excel XP with Windows 2000
The function below is designed to locate the last used column in the sheet. If the sheet is blank, the function should return the integer zero. The problem is when the sheet is blank it generates the error "Object variable or with block not set." I've looked at it so long I can't see what is wrong. NOTE: Lines 2 and 3 should be on the same line
Dim intColumn As Intege
intColumn = ActiveSheet.UsedRange.Find(What:="*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Colum
If IsEmpty(intColumn) Then ColumnLastFilled =
If Not IsEmpty(intColumn) Then ColumnLastFilled = intColum
Thanks in advance
The function below is designed to locate the last used column in the sheet. If the sheet is blank, the function should return the integer zero. The problem is when the sheet is blank it generates the error "Object variable or with block not set." I've looked at it so long I can't see what is wrong. NOTE: Lines 2 and 3 should be on the same line
Dim intColumn As Intege
intColumn = ActiveSheet.UsedRange.Find(What:="*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Colum
If IsEmpty(intColumn) Then ColumnLastFilled =
If Not IsEmpty(intColumn) Then ColumnLastFilled = intColum
Thanks in advance