ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Merging columns based on cell condition (https://www.excelbanter.com/excel-programming/413912-merging-columns-based-cell-condition.html)

TLuebke

Merging columns based on cell condition
 
Reusing this snippet from 2 days ago (thankyou very much) When the condition
in Column A is true I need to merge the cells in columns B-H for that row and
center the string from an input box.
Dim Rng As Range
Dim r As Range, i As Long
Dim strname As String

strname = InputBox("Which Term?", "Term", "")
If strname = vbNullString Then
Exit Sub
End If
Set Rng = Range("A1:A1000")
For i = Rng(Rng.Count).Row To Rng(1).Row Step -1
Set r = cells(i, Rng.Column)

If r.Font.Bold Then

??? ---- Merge columns B-H and center strname <---???

r.EntireRow.PageBreak = xlManual
End If
Next i
End Sub

Your in confusion

Todd


All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com