Nlhicks
Active Member
- Joined
- Jan 8, 2021
- Messages
- 264
- Office Version
- 365
- Platform
- Windows
This code does what it is supposed to do such that it returns this:
What I want it to return is this:
What I want it to return is this:
VBA Code:
Public Sub Bold_in_Concatenate1()
' https://www.mrexcel.com/board/threads/run-my-master-workbook-and-call-another-non-macro-enabled-workbook-and-do-the-edits-to-it-prior-to-saving.1223414/
' Updated: 20221202
' Reason: Reworked Code
Dim wbkData As Workbook
Dim wksWork As Worksheet
Dim blnEnd As Boolean
Dim lngTarget As Long
Dim wksWorkOn As Worksheet
Dim strWbVersion As String
Dim wbkTarget As Workbook
Dim wksFrom As Worksheet
Const cstrPath As String = "C:\Users\nhicks\Documents\Ratings\Saved Versions\"
Const cstrWbData As String = "WAPA-UGPR Facility Rating and SOL Record (Master).xlsm"
Const cstrShData As String = "Line Update"
Const cstrStFileName As String = "WAPA-UGPR Facility Rating and SOL Record (Data File)_v"
Const cstrShFacility As String = "Facility Ratings & SOLs (Lines)"
GetWorkbook_Worksheet cstrPath, cstrWbData, wbkData, cstrShData, wksWork
If wbkData Is Nothing Then
MsgBox "No Object set for '" & cstrWbData & "'. ", vbInformation, cstrMsgTitle
blnEnd = True
GoTo end_here
End If
If wksWork Is Nothing Then
MsgBox "No Object set for '" & cstrShData & "'. ", vbInformation, cstrMsgTitle
blnEnd = True
GoTo end_here
End If
With wksWork
'assuming that the cells are all located on the same sheet
'??? Range("Q13") is used two-times ???
.Range("D32").Value = ("(" & .Range("L11") & " " & .Range("K13") & " " & .Range("L13") & " " & .Range("Q13") & " " & _
"," & " " & .Range("O11") & " " & .Range("N13") & " " & .Range("O13") & " " & .Range("Q13") & ")")
.Range("D32").Font.Bold = True
End With
GetWorkbook_Worksheet cstrPath, strWbVersion, wbkTarget, cstrShFacility, wksWorkOn
' With wksWorkOn
' lngLastRow = .Range("A2", .Range("A" & Rows.Count).End(xlUp)).SpecialCells(xlCellTypeVisible).Cells(1).Row
' wksFrom.Range("J13").Value = .Range("A2:A685").SpecialCells(xlCellTypeVisible).Value
'
'End With
end_here:
Workbook_Worksheet2Nothing wbkData, wksWork
If blnEnd Then End
Call Show_Update
End Sub