ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   defining a range compile error (https://www.excelbanter.com/excel-programming/371729-defining-range-compile-error.html)

Janis

defining a range compile error
 
I get an invalid procedure call on defining the Rng variable. Why is that it
looks like it should work.

Thanks,

Sub deleteDateRow1()
Dim Rng As Range
Set Rng = Range("A1")
With Rng
If IsDate(.Value) Then
FrReptDate = .Value
ToReptDate = .Offset(0, 1).Value

..EntireRow.Delete Shift:=xlUp
Else
Exit Sub
End If
End With
End Sub

Tom Ogilvy

defining a range compile error
 
code works fine for me.

--
Regards,
Tom Ogilvy

"Janis" wrote in message
...
I get an invalid procedure call on defining the Rng variable. Why is that
it
looks like it should work.

Thanks,

Sub deleteDateRow1()
Dim Rng As Range
Set Rng = Range("A1")
With Rng
If IsDate(.Value) Then
FrReptDate = .Value
ToReptDate = .Offset(0, 1).Value

.EntireRow.Delete Shift:=xlUp
Else
Exit Sub
End If
End With
End Sub





All times are GMT +1. The time now is 06:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com