View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
mangesh_yadav[_265_] mangesh_yadav[_265_] is offline
external usenet poster
 
Posts: 1
Default Sub or function not defined.


Change your code to:

Private Sub CheckBox1_Click()
If Range("Z20") = "1" Then
Range("G20").Select
Selection.Copy
Range("AA20").Select
ActiveSheet.Paste
Range("G20").Select
ActiveCell.FormulaR1C1 = "=RC[20]*1.1"
Range("G20").Select
ElseIf Range("Z20") = "2" Then
Range("C20").Select
Selection.Copy
Range("AA20").Select
ActiveSheet.Paste
Range("C20").Select
ActiveCell.FormulaR1C1 = "=RC[20]*1.1"
Range("C20").Select
End If
End Sub



Changes:
You had Cell(Z20="1")
which you probably meant
Range("Z20")=1

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=376988