Results 1 to 7 of 7

Run-time error '91': Object variable or With block variable not set

Threaded View

  1. #1
    Registered User
    Join Date
    11-30-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    8

    Run-time error '91': Object variable or With block variable not set

    Hi, I have very little idea of how to program in VBA but I've managed so far by consulting internet forums to obtain the following code to do what I need, but I am getting an error and I don't know what is wrong? Here is the code:

    Public Sub formula1()
        
        Dim Range1, Range2, Range3, Range4, Range5 As Range
        
    
        Range1 = Range("O3").formula = "=IF(L3="",IF(AND(L3="",L4=""),0,1),100)"
        Range2 = Range("P3").formula = "=IF(L3="",IF(AND(L3="",L4=""),P2,P2),P2+1)"
        Range3 = Range("Q3").formula = "=IF(L3="",IF(L4="",IF(R4="",ROUND(Q2+1,0),Q2+0.0001),ROUND(Q2+1,0)),IF(AND(L3="",L4=""),Q2+0.0001,IF(L4="",Q2+0.0001,ROUND(Q2+1,0))))"
        Range4 = Range("R3").formula = "=IF(L3="",R2&CHAR(10)&M3,M3)"
        
        Range5 = Range("O3:R" & Range("a65000").End(xlUp).Row).FillDown
        
    End Sub
    Last edited by VBAn00b; 12-01-2010 at 02:29 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1