• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

code does not support property or method

Pilot5000

New Member
i have the following code that i converted from lotus123

Code:
Sub CLCDTL24()
'B1_4 2yr Avg
Application.ScreenUpdating = False
If Sheets("sheet A").Range("BH1301") = 1 Then Application.Run CLCDTL24N
If Range("G1207") <= Sheets("sheet D").Range("C3") Then Application.Run CLCDTL210
End If
End If
Application.ScreenUpdating = True
End Sub

every time i try to run it i get the message "Object doesn't support this property or method" any idea how to fix that ???
thank you in advance everyone
 

Attachments

  • Module Mr Excel_2.jpg
    Module Mr Excel_2.jpg
    455.7 KB · Views: 0
  • Module Mr Excel_1.jpg
    Module Mr Excel_1.jpg
    665.5 KB · Views: 0
Last edited by a moderator:
I think you're calling the subs the wrong way. Should be:
Code:
Sub CLCDTL24()
'B1_4 2yr Avg
Application.ScreenUpdating = False
If Worksheets("sheet A").Range("BH1301") = 1 Then
    Call CLCDTL24N
    If Range("G1207") <= Worksheets("sheet D").Range("C3") Then
        Call CLCDTL210
    End If
End If
Application.ScreenUpdating = True
End Sub
 
Hi ,

I ran your code without any error message ; from your screenshots I am not able to find any tab named sheet A or sheet D. Of course , this should not generate the error message you have posted ; can you indicate the line which is highlighted when program execution halts on an error ?

Narayan
 
Hi luck
thank you but what i really need is with the "elseif" so if first " IF" compile with the condition then Call CLCDTL24N if not the check the second " IF " and if this compile with the condition then Call CLCDTL210
 
Easy enough.
Code:
Sub CLCDTL24()
'B1_4 2yr Avg
Application.ScreenUpdating = False
If Worksheets("sheet A").Range("BH1301") = 1 Then
    Call CLCDTL24N
ElseIf Range("G1207") <= Worksheets("sheet D").Range("C3") Then
    Call CLCDTL210
End If
Application.ScreenUpdating = True
End Sub[/code
 
Luck thank you very much i was able to figure that out, and it work as i wanted, even tough i really appropriate your effort, moreover, now i have different problems, i have the following code :
Code:
Sub CLCDTL25()
'B1_2()_Best
Dim Ws As Worksheet
Application.ScreenUpdating = False
'Sheets("Data Input Area").Select
Range("K1207").Value = Sheets("D").Range("E3").Value
Range("O1207").Value = "Bst"
Range("J1810").Value = Sheets("D").Range("P5").Value
Range("D1810:H1810").ClearContents
Range("F1810").Value = "Best Year's Efficiency:"
Range("O1810").Value = "Bst"
Range("K1264").Value = Sheets("D").Range("E22").Value
Range("O1264").Value = "Bst"
Range("I1207").Value = "Lowest Year's Cost %"
Application.Goto Range("D1204"), True
'Range("K1207").Select
Application.Calculate
Application.ScreenUpdating = True
End Sub
this code is following the code you help me to clear , ans i assigned a click button to this code , this code is written as procedure on the sheet in VBA and not as module. and every time i click the button nothing happens , the code take place only if i run it from the VBA location by the Debug step function , and idea why ???????
 
All of the Range objects in a sheet module, if given no parent worksheet, will refer to the sheet that the code is in. Is that what you want?

Is the macro assigned correctly to the button?
At the beginning of the code, you create a WS variable, but you don't do anything with it. Is that intentional?

PS. My name is "Luke", not "Luck".
 
Back
Top