macro to run on a list of hyperlinks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a lot of small changes I make in a standardized form (an excel
spreadsheet). The forms are stored in multiple locations on the network but
I have a list in a worksheet that has hyperlinks to every form. I am trying
to find a way to speed the process up of making the changes. I put an
example of a small change below. Can I make a macro that would in a selected
range open hyperlinks from my list, make the change, save the doc and then
move down the list to the next hyperlink?

Thanks,


Todd


Sub changes()
' Keyboard Shortcut: Ctrl+q
'
Range("G15:G101").Select
Selection.NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(*
""-""??_);_(@_)"
Range("I90").Select
Selection.ClearContents
Range("G89").Select
ActiveCell.FormulaR1C1 = "1"
ActiveWindow.LargeScroll Down:=-2
Range("A1").Select
ActiveWorkbook.Save
End Sub
 
'PUT CURSOR ON FIRST HYPERLINK AND RUN PROCEDURE
'CODE WILL RUN UNTIL IT COMES TO A CELL
' WITHOUT A HYPERLINK
Dim strCurrentWorkbook As String

On Error Resume Next

strCurrentWorkbook = ActiveWorkbook.Name

Do
If Len(ActiveCell.Value) <> 0 Then
If ActiveCell.Hyperlinks.Count <> 0 Then
ActiveCell.Hyperlinks(1).Follow NewWindow:=True
'--------------------------------------
'YOUR CODE FOR MAKING CHANGES GOES HERE
'--------------------------------------
ActiveWorkbook.Save
Else
Exit Do
End If
End If
Workbooks(strCurrentWorkbook).Activate
ActiveCell.Offset(1, 0).Select
Loop

ActiveWindow.WindowState = xlMaximized

hth,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top