some of the cells have values by using macro it need to appear in text boxes,if the condition is matched

bhandari

Active Member
Joined
Oct 17, 2017
Messages
359
Sheet 2
A1=10
A2=20
A3=30
A4=40
A5=50---etc(Values are not constant)
By using this code the shape is appeared after every 5 columns ...
if there is a box(shape) position appeared at 5th column then
match with that box(shape) and add one more box(Shape) above this "Arrow2" box as well as insert the text with A1 Cell name
Please find the link below

https://drive.google.com/file/d/1h78WukYH0eDehj8As4u-dHkodMybLUN-/view
i am looking for a macro with if condition

Code:
Sub populatearrow()
Dim shapi As Shape

Set shapi = Sheets("Sheet2").Shapes("Arrow2")
Dim shap As Shape
Dim x
Dim position
position = shapi.Left
For x = 2 To 11

Set shap = Sheets("Sheet2").Shapes.AddShape(shapi.AutoShapeType, position + Sheets("Sheet2").Cells(1, 2).Width * 5, shapi.Top, shapi.Width, shapi.Height)

shap.Visible = True
position = shap.Left
Set shap = Nothing
Next
Set shapi = Nothing
End Sub
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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