How to change visio shape text based on worksheet row content using for each loop?

Michael Ziegler

New Member
Joined
Jul 2, 2019
Messages
8
I created this for each loop to add the devices ip address to the shapes text it find the devices if i put a static name on the code but It doesn't look like is reading the worksheet names from column A


When I change the loop and write one of the shapes name on it I'm able to change any of the shapes names. But as is it doesn't seem to be reading the values from the worksheet and the worksheet is active and open.


Here is my code


Code:
For Each node In ActivePage.Shapes




          If node.Text = Sheets("results").Cells(WhatRow, "A").Value Then


          node.Text = Sheets("results").Cells(WhatRow, "A").Value & 
Chr(13) & Chr(10) & "IP Address" & Chr(13) & Chr(10) & cel.Offset(0, 
2).Value


           WhichRow = WhichRow + 1






            Else


            End If




    Next node
I need the loop to be able to go thru column a and compare the values with the shape names and if it finds a match then change the name to the column a value plus the value from the corresponding cell in column c which is the device ip. Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,630
Messages
6,173,454
Members
452,514
Latest member
cjkelly15

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