Need some help I am a newbie to VBA

Spiffierlime

New Member
Joined
Mar 10, 2021
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Need help solving my VBA Riddle please someone with the professional knowledge, Please

VBA

Private Sub CommandButton3_Click()

If Range("V1").Value = ("Complete") Then ' this code needs changing to look at a cell on another sheet i.e sheet 1 Range A1
ActiveSheet.Shapes("Oval 57").Fill.ForeColor.RGB = RGB(252, 74, 235)
Else
ActiveSheet.Shapes("Oval 57").Fill.ForeColor.RGB = RGB(255, 255, 255)

End If
'Need to loop this code to check Range V2 and fill Oval 58 and so on RangeV3, and fill oval 59, RangeV4 and fill Oval 60 untill the end
End Sub
 
Ok it passed that bit but error can't find
ActiveSheet.Shapes("Oval " & i).Fill.ForeColor.RGB = RGB(252, 74, 255)
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
when I hover the mouse over Oval 1 it does allow me to selct instead a hand appers as if to hyperlink, but the oval has turned yellow
 
Upvote 0
Is the shape actually called "Oval 1"?
If the cursor is changing to a hand it suggests that you have a macro assigned to the shape.
 
Upvote 0
Yes it's called Oval 1, and yes I did, have removed the macro,

Still Error on
Error can't find
ActiveSheet.Shapes("Oval " & i).Fill.ForeColor.RGB = RGB(252, 74, 255)
 

Attachments

  • Oval 1.PNG
    Oval 1.PNG
    31.8 KB · Views: 5
Upvote 0
Not quite sure why you have a rectangle called Oval, but that's not a problem.
Are you running the code from the command button that's visible in your image?
 
Upvote 0
Do you have both shapes Oval 1 & Oval 2?
 
Upvote 0
Double check that you don't have two or more spaces between Oval & 1
Other than that I can't think why you would get the error.
 
Upvote 0

Forum statistics

Threads
1,214,901
Messages
6,122,157
Members
449,068
Latest member
shiz11713

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