how to do not change the font and font size i assign to the cell where's the macro result i show..
i want to set a font in my sheet 2 for the result.. but when i run the macro the result of the program. will change the font style and size of my result..
this is my program.
Sub Macro1()
Dim sh1 As Worksheet
Dim sh2 As Worksheet
Dim lastRow As Long, r As Long
Dim destRow As Long, qty As Integer
With ThisWorkbook
Set sh1 = .Sheets(1)
Set sh2 = .Sheets(2)
End With
Application.ScreenUpdating = False
lastRow = sh1.Cells(Rows.Count, 1).End(xlUp).Row
sh2.Range("3:" & Rows.Count).ClearContents
destRow = 3
For r = 3 To lastRow
qty = sh1.Cells(r, 3)
If qty > 0 Then
sh1.Cells(r, 1).Resize(, 7).Copy sh2.Cells(destRow, 2).Resize(qty)
sh2.Cells(destRow, 4).Resize(qty) = 1
destRow = destRow + qty
End If
Next r
Application.ScreenUpdating = True
End Sub
Bookmarks