Talk About Network

Google





Mac > Excel Office for Mac > Re: How unlink ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 15 of 24 Topic 6410 of 6965
Post > Topic >>

Re: How unlink a whole column?

by Bill W <billwarren@[EMAIL PROTECTED] > Oct 14, 2008 at 06:02 AM

On Oct 13, 10:50=A0pm, ke...@[EMAIL PROTECTED]
 wrote:
> Bob, I have plenty of free space. Don't fixate on any particular file.
> Will all excel files, this is situation.
> You said there is not edit hyperlnk box, did you see screenshot. What I
a=
m only one to have a edit hyperlink box?
>
> You say there is only insert one? Where is the remove button?
> Send a screenshot with insert hyperlink with a remove button

Greetings,

I have the same experience on Excel 2004 on Mac OS X 10.5.5, that is
not getting the remove hyperlinks for multiple cells.  Since my
workflow at work includes linking items to sup****ting do***entation, I
created the following VB scripts to remove the hyperlinks.  Being a VB
script, this will not work with Excel 2008, but it might give you
enough to write an AppleScript that does the same thing.

There is a fair amount of fixing the formatting once the hyperlink is
removed (based on the formatting I use), but this should hopefully
help.  I don't know that I've tried this with an entire column
selected, maybe it works, if not just select cell 1 to n or use "all
sheets"

Sub RemoveAllHyperlinks()
    theResult =3D "Cancel"
    On Error Resume Next
    theResult =3D MacScript("display dialog ""Remove Hyperlinks from the
current Selection or ALL SHEETS of the active workbook?"" buttons
{""Cancel"", ""Selection"", ""ALL SHEETS""} default button 2 with icon
2")
    On Error GoTo 0
    If theResult =3D "Cancel" Then Exit Sub
    If theResult =3D "button returned:Selection" Then
        thisSheet =3D ActiveWorkbook.ActiveSheet.Name
        For Each h In Selection.Hyperlinks
            Call RemoveAllHyperlinks_Do(h, thisSheet)
        Next h
    ElseIf theResult =3D "button returned:ALL SHEETS" Then
      For Each sht In ActiveWorkbook.Sheets 'for every sheet in WB
            thisSheet =3D sht.Name
            For Each h In sht.Hyperlinks
                Call RemoveAllHyperlinks_Do(h, thisSheet)
            Next h
        Next sht
    End If
End Sub

Sub RemoveAllHyperlinks_Do(h, thisSheet)
                'Get the formatting to reapply because removing
hyperlink messes-up formatting besides color & underlining
                thisRange =3D h.Range.Address()
                theFontFace =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Font.FontStyle
                theNumFormat =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).NumberFormat
                theAlignment =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).HorizontalAlignment
                'theBorderFormat =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders.LineStyle
                theTopBorder =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlTop).LineStyle
                If theTopBorder <> xlLineStyleNone Then
theTopBorderWeight =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlTop).Weight
                theBottomBorder =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlBottom).LineSty=
le
                If theBottomBorder <> xlLineStyleNone Then
theBottomBorderWeight =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlBottom).Weight
                theLeftBorder =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlLeft).LineStyle
                If theLeftBorder <> xlLineStyleNone Then
theLeftBorderWeight =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlLeft).Weight
                theRightBorder =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlRight).LineStyl=
e
                If theRightBorder <> xlLineStyleNone Then
theRightBorderWeight =3D
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlRight).Weight
                h.Delete
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Font.FontStyle =3D
theFontFace
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).NumberFormat =3D
theNumFormat
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).HorizontalAlignment
=3D theAlignment
                If theTopBorder <> xlLineStyleNone Then
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlTop).LineStyle
=3D theTopBorder
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlTop).Weight
=3D theTopBorderWeight
                End If
                If theBottomBorder <> xlLineStyleNone Then
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlBottom).LineSty=
le
=3D theBottomBorder
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlBottom).Weight
=3D theBottomBorderWeight
                End If
                If theLeftBorder <> xlLineStyleNone Then
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlLeft).LineStyle
=3D theLeftBorder
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlLeft).Weight
=3D theLeftBorderWeight
                End If
                If theRightBorder <> xlLineStyleNone Then
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlRight).LineStyl=
e
=3D theRightBorder
=20
ActiveWorkbook.Sheets(thisSheet).Range(thisRange).Borders(xlRight).Weight
=3D theRightBorderWeight
                End If
End Sub
 




 24 Posts in Topic:
How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-02 16:32:57 
Re: How unlink a whole column?
Bob Greenblatt <bob@[E  2008-10-03 07:58:04 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-04 16:55:00 
Re: How unlink a whole column?
Bob Greenblatt <bob@[E  2008-10-06 07:57:42 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-07 21:05:25 
Re: How unlink a whole column?
Bob Greenblatt <bob@[E  2008-10-08 07:44:01 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-09 13:00:46 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-09 12:57:57 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-09 13:45:58 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-09 13:47:02 
Re: How unlink a whole column?
Bob Greenblatt <bob@[E  2008-10-09 17:07:29 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-11 09:11:31 
Re: How unlink a whole column?
Bob Greenblatt <bob@[E  2008-10-13 08:18:26 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-13 19:50:34 
Re: How unlink a whole column?
Bill W <billwarren@[EM  2008-10-14 06:02:55 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-15 19:22:52 
Re: How unlink a whole column?
Bob Greenblatt <bob@[E  2008-10-16 07:47:21 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-22 12:26:18 
Re: How unlink a whole column?
Bob Greenblatt <bob@[E  2008-10-22 16:19:12 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-24 16:17:57 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-10-29 10:50:45 
Re: How unlink a whole column?
JE McGimpsey <jemcgimp  2008-10-29 14:44:50 
Re: How unlink a whole column?
kevs1@[EMAIL PROTECTED]   2008-11-02 12:35:58 
Re: How unlink a whole column?
JE McGimpsey <jemcgimp  2008-11-02 13:52:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 2:56:55 PST 2009.