Need Help in VBA Code

Rohith1324

Board Regular
Joined
Feb 27, 2018
Messages
114
Hi,

Currently one of the line in my code is :
bot.FindElementByXPath("//*[@id='createNewForm']/div[3]/div/div/div/ul/li[4]/a/span[1]").Click

the above highlighted value "4" should get replaced with the value from below specified formula :

c.Offset(0, 1).Value

So I have tried adding the above cell reference in the code as below , but not working :

bot.FindElementByXPath("//*[@id='createNewForm']/div[3]/div/div/div/ul/li" & c.Offset(0, 1).Value & "/a/span[1]").Click

can someone please help me in getting that incorporated in code please.

Regards,
Rohit
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
did you try removing the Quotes "" on both the sides?
like this:
& c.Offset(0, 1).Value &

instead of :
"& c.Offset(0, 1).Value & "
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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