Hi!
I've a sub (lists opened workbooks name) in wb1 in module1:
It works perfectly, but when I open my other wb (lets say wb2) which contains module1 (gives the comment of the target range):
and Module2 (checks if there's a comment in the target range):
and run (step-by step), after
"ActiveSheet.Range("T1:T65536").ClearContents"
it jumps to Module2 loops through the cells which contains the formula, then Module1 loops through the cells which contains the formula and stops. Never gets back to the macro I intended to run.
Can I prevent to run these functions (or any function/sub in other worksheet)?
Or is there another option?
Than you,
YvorL
I've a sub (lists opened workbooks name) in wb1 in module1:
Code:
Sub Auto_Open()
Dim wb As Workbook
Dim Wbc As Byte
ActiveSheet.Range("T1:T65536").ClearContents
Wbc = 1
For Each wb In Application.Workbooks
If wb.Name <> "wb1.xls" Then
Cells(Wbc, 20) = wb.Name
Wbc = Wbc + 1
End If
Next
It works perfectly, but when I open my other wb (lets say wb2) which contains module1 (gives the comment of the target range):
Code:
Function MyComment(rng As Range)
Application.Volatile
Dim str As String
str = Trim(rng.Comment.Text)
MyComment = str
End Function
and Module2 (checks if there's a comment in the target range):
Code:
Function HasComment(Target As Range) As Boolean
On Error Resume Next
Dim txt As String
txt = Target.Comment.Text
HasComment = Err.Number = 0
Err.Clear
End Function
and run (step-by step), after
"ActiveSheet.Range("T1:T65536").ClearContents"
it jumps to Module2 loops through the cells which contains the formula, then Module1 loops through the cells which contains the formula and stops. Never gets back to the macro I intended to run.
Can I prevent to run these functions (or any function/sub in other worksheet)?
Or is there another option?
Than you,
YvorL