Results 1 to 2 of 2

Thread: Range of Object failed?

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2005
    Posts
    42

    Range of Object failed?

    Hi, the following code in my VBA program is causing a range of object failed error.
    VB Code:
    1. Range(Sheets(sheetname).Cells(start, startCol), Sheets(sheetname).Cells(50, startCol)).ClearContents

    It would only error if sheetname is not the current active sheet opened. Therefore I added
    VB Code:
    1. Range(Sheets(sheetname).Cells(start,startCol).Value, Sheets(sheetname).Cells(50,startCol).Value).Activate
    before it.
    It STILL complained! I ran out of ideas.
    Why wouldnt the compiler like the following code even after I activate the sheet?
    Last edited by mchow2469; Jul 26th, 2005 at 05:30 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width