sdohertyccb
Board Regular
- Joined
- Feb 15, 2005
- Messages
- 91
I must be having a brain cramp on this one, I have not run into this problem before. I am trying to clear contents from a dynamic range in a workbook and I am getting an object defined error. I'm wondering if it is because I declared the "clear_rng" as a range, but don't understand why that would be.
Here is what I have (Highlight is the error):
Any help you can give is greatly appreciated.
Thanks in advance.
Here is what I have (Highlight is the error):
Code:
Sub get_recon()
Dim gl_filename1 As String
Dim gl_pathname1 As String
Dim gl_filename2 As String
Dim gl_pathname2 As String
Dim lastrow As Integer
Dim file_lastrow As Integer
Dim file_lastcol As Integer
Dim Wkbk As Workbook
Dim r As Range
Dim c As Range
Dim clear_rng As Range
Dim clear_rng_rows As Integer
Dim clear_rng_cols As Integer
Set Wkbk = ThisWorkbook
gl_filename1 = Range("gl_filename1")
gl_pathname1 = Range("gl_pathname1")
gl_filename2 = Range("gl_filename2")
gl_pathname2 = Range("gl_pathname2")
lastrow = Range("recon.lastrow") + 1
clear_rng_rows = Range("clear_rng_rows")
clear_rng_cols = Range("clear_rng_col")
[highlight]clear_rng = Sheets("reconcile").Range(Cells(lastrow, 4)).Offset(clear_rng_rows, clear_rng_cols)[/highlight]
Sheet10.Activate
Range(clear_rng).Select
Selection.ClearContents
Any help you can give is greatly appreciated.
Thanks in advance.