stuartgb100
Active Member
- Joined
- May 10, 2015
- Messages
- 322
- Office Version
- 2021
- Platform
- Windows
Hi,
With a lot of help, I now have a working routine. Thanks.
The routine was designed to work on an android smartphone running 365.
I found out soon that macros are not supported, so I had to work around that limitation,
and then save the workbook as a .xlsx file (without code).
It seemed to work, but then I found this problem:
When a hyperlink is clicked in the .xlsm version, it displays the relevent worksheet, and I use this given code to make
the cell being linked at the top of the window:
This works fine in the .xlsm version, but when saved as a .xlsx workbook,
the code is stripped out.
Consequentially, when running the .xlsx version on the smarphone, the display does not 'snap' to the required row.
Is there a way around this, or must I accept the limitation ?
Many thanks.
With a lot of help, I now have a working routine. Thanks.
The routine was designed to work on an android smartphone running 365.
I found out soon that macros are not supported, so I had to work around that limitation,
and then save the workbook as a .xlsx file (without code).
It seemed to work, but then I found this problem:
When a hyperlink is clicked in the .xlsm version, it displays the relevent worksheet, and I use this given code to make
the cell being linked at the top of the window:
VBA Code:
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
'to set the target row to display
'Application.Goto Reference:=ActiveCell, Scroll:=True
'to set the target row and column to display
'Application.Goto Reference:=Cells(ActiveCell.Row - 1, 1), Scroll:=True
If ActiveCell.Row = 1 Then
Application.Goto Reference:=Cells(ActiveCell.Row, 1), Scroll:=True
Else
Application.Goto Reference:=Cells(ActiveCell.Row - 1, 1), Scroll:=True
End If
End Sub
This works fine in the .xlsm version, but when saved as a .xlsx workbook,
the code is stripped out.
Consequentially, when running the .xlsx version on the smarphone, the display does not 'snap' to the required row.
Is there a way around this, or must I accept the limitation ?
Many thanks.