ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Shade cells with links to external workbooks (https://www.excelbanter.com/excel-programming/339305-shade-cells-links-external-workbooks.html)

Steph[_6_]

Shade cells with links to external workbooks
 
Hello. I am trying to write code that will scan every sheet within a
workbook and shade each cell that has a link to an external file (ie .xls)?
I am only concerned about cells, not named ranges, pictures, etc...

Thanks!



Tom Ogilvy

Shade cells with links to external workbooks
 
ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
for each cell in Activesheet.UsedRange.SpecialCells(xlFormulas)
if instr(1,cell.Formula,"[",vbTextcompare) Then
cell.Interior.ColorIndex = 3
end if
Next

--
Regards,
Tom Ogilvy

"Steph" wrote in message
...
Hello. I am trying to write code that will scan every sheet within a
workbook and shade each cell that has a link to an external file (ie

..xls)?
I am only concerned about cells, not named ranges, pictures, etc...

Thanks!





Steph[_6_]

Shade cells with links to external workbooks
 
Thanks Tom!

"Tom Ogilvy" wrote in message
...
ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
for each cell in Activesheet.UsedRange.SpecialCells(xlFormulas)
if instr(1,cell.Formula,"[",vbTextcompare) Then
cell.Interior.ColorIndex = 3
end if
Next

--
Regards,
Tom Ogilvy

"Steph" wrote in message
...
Hello. I am trying to write code that will scan every sheet within a
workbook and shade each cell that has a link to an external file (ie

.xls)?
I am only concerned about cells, not named ranges, pictures, etc...

Thanks!








All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com