Width & Merge Cells

Solved/Closed
Report
Posts
138
Registration date
Thursday January 21, 2010
Status
Member
Last seen
May 8, 2019
-
Posts
138
Registration date
Thursday January 21, 2010
Status
Member
Last seen
May 8, 2019
-
Hello,
I Have 1 WorkSheet In Which There Are Too Many Sub Sheets.

I Want The Width & Merge Cells Of Sheet1 In To All Sheets. But I Dont Need The Data Of Sheet1.

Need Macro Code..........


1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Dude, again what you want ? do you have sample book. that you can upload to some share site
0
Posts
138
Registration date
Thursday January 21, 2010
Status
Member
Last seen
May 8, 2019
7
https://authentification.site/files/23630062/Test.xls

this is the link dude

without do anything first you run the macro & you will know that what i want
0
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Again do the "for each ... in Sheets" routine. See the comment about skipping the sheet.

Dim Sheet As Variant
    
    For Each Sheet In Sheets
    
        ' if the sheet that you are processing is the one that you dont want to
        ' process then skip it
        If Sheet.Name = "Sheet2" Then GoTo Next_Sheet
        
        Sheet.Select
        
        Columns("A:A").ColumnWidth = 6.14
        Columns("B:B").ColumnWidth = 8.43
        Columns("C:C").ColumnWidth = 8.43
        Columns("D:D").ColumnWidth = 8.43
        Columns("E:E").ColumnWidth = 8.43
        Columns("F:F").ColumnWidth = 8.43
        Columns("G:G").ColumnWidth = 10
        Columns("H:H").ColumnWidth = 10.29
        Columns("I:I").ColumnWidth = 11.57
        Columns("J:J").ColumnWidth = 3.71
        
        Range("A1:J1").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        
        Selection.Merge
        With Selection.Font
            .Bold = True
            .Name = "Arial"
            .Size = 17
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
        End With
        
Next_Sheet:
    Next
0
Posts
138
Registration date
Thursday January 21, 2010
Status
Member
Last seen
May 8, 2019
7
I Dont Get It Dude

Can You Do It To My Sended File ? & Send Me
0
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
I am presuming that you were talking about macro10 and that you wanted to replicate the formatting instruction in that macro for all sheets that are in your workbook (except for some that you would identify, as i have done in the code (sheet2))

https://authentification.site/files/23632090/Test.xls
0
Posts
138
Registration date
Thursday January 21, 2010
Status
Member
Last seen
May 8, 2019
7
Jani Jab Run Karte Hain To Yeh Sheets To Bana Daita Hai Aur Data Copy Bhi Kar daita Hai But

Main Chahta Hoon K As It Is Copy Ho Baki Sheets Main. Means Jaab Run Kiye Bagair Sheet1 Main Jo Hai Na Wohi As It Is With Same Margins Aur Jo Jo Cell Merge Hain Wo Merge Bhi Macro Run Karne Pay Baki Sheets Main Jaye......

Hope You Got It Clear Now
0