A
al
Any vba expert can help in making this macro work on at two sheets in a
workbook or 2 workbooks - I would like to place the result in a
diffrent sheet & it shows the proper link.Thxs
Dim UserRange As Range
Output = "=sum(" & Selection.Address(External:=False,
RowAbsolute:=False, ColumnAbsolute:=False) & ")"
Prompt = "Select a cell for the output."
Title = "Select a cell"
On Error Resume Next
Set UserRange = Application.InputBox( _
Prompt:=Prompt, _
Title:=Title, _
Default:=ActiveCell.Address, _
Type:=8) 'Range selection
If UserRange Is Nothing Then
MsgBox "Canceled."
Else
UserRange.Range("A1") = Output
End If
End Sub
workbook or 2 workbooks - I would like to place the result in a
diffrent sheet & it shows the proper link.Thxs
Dim UserRange As Range
Output = "=sum(" & Selection.Address(External:=False,
RowAbsolute:=False, ColumnAbsolute:=False) & ")"
Prompt = "Select a cell for the output."
Title = "Select a cell"
On Error Resume Next
Set UserRange = Application.InputBox( _
Prompt:=Prompt, _
Title:=Title, _
Default:=ActiveCell.Address, _
Type:=8) 'Range selection
If UserRange Is Nothing Then
MsgBox "Canceled."
Else
UserRange.Range("A1") = Output
End If
End Sub