Sean Connecticut
Sean Connecticut

Reputation: 305

MSG Box display workbook

I have an easy question but for whatever reason can´t find it online. I want a msgbox to return me specific cells that apply to a set of conditions. For each cell I want it to say what workbook the cell is in.

MsgBox ("Error: " & cl.Address & " is " & cl.Value & " " & thisworkbook.Name)

is what I have in my code. What its returning is the name of the reporting workbook and not where the actual error is located.

Please help

Upvotes: 0

Views: 69

Answers (1)

Kazimierz Jawor
Kazimierz Jawor

Reputation: 19067

In your situation you should go this way:

MsgBox ("Error: " & cl.Address & " is " & cl.Value & " " & cl.Parent.Parent.Name)

the final part will use hierarchy of Excel Object model- from Cell >> to Sheet >> to Workbook...

Upvotes: 4

Related Questions