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
 
Solved it the code is looking at D1 in MSFWSB as the first lookup when the data starts in D2, I created A NEW SHEET and created a new command and pasted your code in it works but does not work on the sheet with the chart, I will create a new chart as this came from someone else. how do I get the code to start looking from cell D2 instaed of D1?
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Use
VBA Code:
For i = 2 To 3
 
Upvote 0
when I change For i = 2 To 3, I get error saying can't find Specified item after the ELSE
 
Upvote 0
If your shapes are named starting at 1 you will need to make this change
VBA Code:
ActiveSheet.Shapes("Oval " & i - 1)
 
Upvote 0
Dear Sir, I must express sincere thanks to you, without you, i would not of been able to complete my objective.

Thankyou very much !
Is there a donation area on this site?
 
Upvote 0
If I wan't do change the line colour and weight of the shape before and after, , how would I plug this into the code, learning so much from you?
 
Upvote 0
As that is a different question, you will need to start a new thread. Thanks
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,712
Members
449,093
Latest member
Mnur

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