Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-31-2023, 08:02 PM
soroush.kalantari soroush.kalantari is offline Error when hyperlinking Excel cells to worksheets based on the cell values for sheets whose name  in Windows 10 Error when hyperlinking Excel cells to worksheets based on the cell values for sheets whose name  in Office 2016
Competent Performer
Error when hyperlinking Excel cells to worksheets based on the cell values for sheets whose name  in
 
Join Date: Jun 2021
Posts: 124
soroush.kalantari is on a distinguished road
Default Error when hyperlinking Excel cells to worksheets based on the cell values for sheets whose name in

I have written following macro to hyperlink Excel cells to worksheets based on the cell value. It failes to work for sheets whose name include “-“. (See cell A4 in the excel attachment.)
Can you guide me on this issue?




Sub FShyeperlink()
On Error Resume Next

Dim n As Integer
Dim i As Integer
Dim rng As Range
n = Selection.Rows.Count
Set rng = Selection


Selection.Hyperlinks.Delete
For i = 1 To n


rng(i).Select

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
Selection.Value & "!A1"
Next i
End Sub
Attached Files
File Type: xlsm sheethyperlink.xlsm (18.6 KB, 4 views)
Reply With Quote
 

Tags
hyperlink



Similar Threads
Thread Thread Starter Forum Replies Last Post
Merging 2 different cells containing IF formula & change in cell values based on multiple time frame jay_excel Excel 0 07-29-2017 11:04 PM
Error when hyperlinking Excel cells to worksheets based on the cell values for sheets whose name  in copy cells from a worksheet into other worksheets based on Criteria Elton Wolter Excel Programming 4 04-16-2016 08:44 AM
Error when hyperlinking Excel cells to worksheets based on the cell values for sheets whose name  in Column B Cell 25 of all worksheets copies data found in the lower cells ... rpcalo Excel 3 03-10-2016 03:38 AM
Error when hyperlinking Excel cells to worksheets based on the cell values for sheets whose name  in Reference another workbook and return values from the same cell across multiple sheets/tabs lwls Excel Programming 5 11-08-2014 02:11 PM
Change values in cells based on criteria SaneMan Excel Programming 2 02-02-2012 07:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft