code wont run

kevin lazell

Well-known Member
Joined
Jun 2, 2004
Messages
513
Sub Sheet2_Button185_Click()
Dim A As String
Dim txt As String
Dim hf As Variant
Dim g As Variant
Dim q As Variant
If Range("s12") = 2 Then GoTo one:
*** the above line does not execute ***
g = Range("C" & Rows.Count).End(xlUp): If g = 0 Then Range("z" & Rows.Count).End(xlUp).Offset(1, 0).Value = Range("g1").Value: Range("g1") = Range("a1"): Range("a1") = Range("z1")
q = Range("e" & Rows.Count).End(xlUp): If q = 0 Then Range("z" & Rows.Count).End(xlUp).Offset(1, 0).Value = Range("a1").Value: Range("a1") = Range("z1")
Range("z1") = Range("z2"): Range("z2") = Range("z3"): Range("z3") = Range("z4"): Range("z4") = Range("z5")
If Sheets("sheet1").Range("e17") = 6 Then Range("z5").ClearContents
If Sheets("sheet1").Range("e17") = 5 Then Range("z4").ClearContents
If Sheets("sheet1").Range("e17") = 4 Then Range("z3").ClearContents
If Sheets("sheet1").Range("e17") = 3 Then Range("z2").ClearContents
GoTo two:
one:
q = Range("e" & Rows.Count).End(xlUp): If q = 0 Then GoTo two:
A = Range("G1"): Range("G1") = Range("A1"): Range("A1") = A
two:
Range("A2:G30").ClearContents
Range("H11") = 1: Range("i11") = 1
Range("B1").Select
txt = Range("A1")
Application.Wait Now + TimeSerial(0, 0, 2)
Application.Speech.Speak " it IS "
Application.Speech.Speak txt
Application.Speech.Speak " TO THROW FIRST GAME ON"
end sub

hi all
i have the above code which works ok except for the highlighted line, the code does not
want to know it. if i check the code using the step into, ie pressing f8 it works fine
can someone please point me in the right direction to solve this problem

cheers
kev
 
There's something weird going on if you had to do something special to get that little test macro to run. The problem is, I don't know what.
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,215,545
Messages
6,125,448
Members
449,227
Latest member
Gina V

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top