PDA

View Full Version : VBA to use Format Painter from one row to another row



elsuji
09-06-2019, 10:48 AM
After copy the data from other sheet, i want that row to be in the same format (with borders). where ever the data is updating the entire row to be same format of B12:G12 all work sheet (sheet4 to 8). can any one help me for this

Artik
09-06-2019, 09:20 PM
If you use the Copy method, the range will be copied along with its formatting
Source_Range.Copy Destination_Range

Artik

elsuji
09-07-2019, 03:41 AM
I am using the following code for copy the data



Dim aaa As String, shArr
aaa = ActiveSheet.Name
shArr = Array("Sheet4", "Sheet5", "Sheet6", "Sheet7", "Sheet8") '<---- Add or remove sheet names as required.
Application.ScreenUpdating = False
For ii = LBound(shArr) To UBound(shArr)
With Sheets(shArr(ii))
Sheets("sheet4").Range("B11:G136").Value = Sheets("Data").Range("A29:F154").Value
Sheets("sheet5").Range("B11:G36").Value = Sheets("Data").Range("A163:F188").Value
Sheets("sheet6").Range("B11:G26").Value = Sheets("Data").Range("A197:F212").Value
Sheets("sheet7").Range("B11:G26").Value = Sheets("Data").Range("A221:F236").Value
Sheets("sheet8").Range("B11:G31").Value = Sheets("Data").Range("A245:F265").Value
End With
Next ii
Sheets(aaa).Activate
Application.ScreenUpdating = True


For example :
Mostly the datas will replace on sheet6 in the range of B20:G26. I want to update the row format(Include border) of Sheet6 B12:G12 to the newly copied rows (till B26:G26)

Like this to be update all the sheets ("Sheet4", "Sheet5", "Sheet6", "Sheet7", "Sheet8")

How to update my above requirement