Prev Previous Post   Next Post Next
  #1   Report Post  
Frazer
 
Posts: n/a
Default Macro problem

Im not too great at macro code, so if anyone could answer a few of the
problems i have with this it would be great....

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If Address = "$Y$3" Then
If Value = "1" Then
Sub Macro1()
Dim cnt As Integer
cnt = 1

For Each c In Worksheets("Sheet1").Range("T5:T10").Cells
Range("T" & cnt).Select
On Error Resume Next
Selection.Hyperlinks(1).Follow NewWindow:=False,
AddHistory:=True
cnt = cnt + 1
Next
End Sub



What this is supposed to do is select a hyperlink in a cell when the macro
is run, based on the value of another number, ie in this case the macro
should only run if the value of cell y3 is 1

The main problem with this is that it doesnt actually recognise the value in
the cell y3, it just runs regardless of the value, so i guess there must be
something wrong there....

Also, the actual macro I am trying to run is from the sub macro1 part down-
it selects hyperlinks in a range of cells and opens them

However, the range part does not work unless i start in cell T1, which i do
not want to do, i need a range from say T5:T10, but in that case it would
only do T1:T5 for some reason

can anyone help???

thnx

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting a macro resulted in a problem militant Excel Discussion (Misc queries) 0 April 26th 05 05:21 AM
Circular Problem needs Macro NICK Excel Discussion (Misc queries) 2 February 1st 05 09:09 AM
External data Macro Problem Excel 97 Craig Kelly Excel Discussion (Misc queries) 1 January 17th 05 03:17 PM
Problem executing a macro from different workbook where it is Sergio Calleja Excel Discussion (Misc queries) 1 January 17th 05 12:38 PM
macro problem Kevin Excel Discussion (Misc queries) 1 December 14th 04 10:47 PM


All times are GMT +1. The time now is 03:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"