Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hardcode Links - edit my code please?
Hi everyone. I have the code below to hardcode all cells with links to an
external workbook. I tried to add an if statement to display a msgbox if the sheet has no external links, but I don't know the correct syntax. When I run this, I get a type mismatch error on the line If rng = Empty Then. Can anyone fix this? Thanks! Sub Hardcode() Dim ws As Worksheet On Error Resume Next Set rng = ActiveSheet.Cells.SpecialCells(xlFormulas) On Error GoTo 0 If rng = Empty Then MsgBox ("No Links in Sheets") Else For Each cell In rng sform = cell.Formula If InStr(sform, "[") Then cell.Formula = cell.Value End If Next End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hardcode Links - edit my code please?
If rng = Empty Then
should be if rng is nothing then -- Regards, Tom Ogilvy "Steph" wrote in message ... Hi everyone. I have the code below to hardcode all cells with links to an external workbook. I tried to add an if statement to display a msgbox if the sheet has no external links, but I don't know the correct syntax. When I run this, I get a type mismatch error on the line If rng = Empty Then. Can anyone fix this? Thanks! Sub Hardcode() Dim ws As Worksheet On Error Resume Next Set rng = ActiveSheet.Cells.SpecialCells(xlFormulas) On Error GoTo 0 If rng = Empty Then MsgBox ("No Links in Sheets") Else For Each cell In rng sform = cell.Formula If InStr(sform, "[") Then cell.Formula = cell.Value End If Next End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Y Axis : Dynamically Hardcode Min/Max Values? | Charts and Charting in Excel | |||
hardcode a column in a formula | Excel Worksheet Functions | |||
Update links box gives Continue or Edit Links dialog | Excel Discussion (Misc queries) | |||
Edit Links: Changing links on a protected worksheet | Excel Discussion (Misc queries) | |||
Change hardcode to ....? | Excel Programming |