willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 888
- Office Version
- 365
- Platform
- Windows
I have a code that creates a file and names it after Cell B1:
Is there a way to also create a hyperlink to this newly created folder to the current active cell?
VBA Code:
Sub Create()
'
' Create Macro
'
Msg = " A new IAR will be created along with a folder in the following directory: S:\Lean Folder\IAR Submissions\" & vbCrLf & "" & vbCrLf & " Do you wish to proceed?"
Ans = MsgBox(Msg, vbYesNo)
Select Case Ans
Case vbYes
Range("B1").Select
Selection.Copy
Range("U1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
For Each lo In ActiveSheet.ListObjects
lo.AutoFilter.ShowAllData
Next lo
Range("B1").Select
Selection.Copy
Range("A3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
MkDir "S:\Lean Folder\IAR Submissions\" & Range("U1").Value 'Would like a hyperlink to the current selected cell at this point
Range(Cells(Selection.Row, 9), Cells(Selection.Row, 9)).Select
ActiveCell.FormulaR1C1 = "New"
With ActiveSheet
.PageSetup.PrintArea = _
.Range("Print_Area").Offset(2).Resize(.Range("Print_Area").Rows.Count - 1, _
.Range("Print_Area").Columns.Count).Address
End With
Case vbNo
GoTo Quit:
End Select
Quit:
Is there a way to also create a hyperlink to this newly created folder to the current active cell?
Last edited: