I know to format a cell as a number it should look something along these lines:
I have the following, and would like values in E:K of copied values to format as number in the following section.
Code:
Columns("D:K").Select
Selection.NumberFormat = "#.00"
I have the following, and would like values in E:K of copied values to format as number in the following section.
Code:
WS1.Range(WS1.Cells(c.Row, "E"), WS1.Cells(c.Row, "K")).Copy
WS2.Cells(lr2, "E").PasteSpecial Paste:=xlPasteValues
Code:
Function Copy()
Dim WS1 As Worksheet, WS2 As Worksheet, lr1 As Long, lr2 As Long, c As Range
Application.ScreenUpdating = False
Set WS1 = Worksheets("ABR")
Set WS2 = ActiveSheet
lr1 = WS1.Cells(Rows.Count, "M").End(xlUp).Row
lr2 = 8
For Each c In WS1.Range("M1:M" & lr1)
If c.Value = "Not Exported" Then
WS1.Range(WS1.Cells(c.Row, "A"), WS1.Cells(c.Row, "C")).Copy
WS2.Cells(lr2, "B").PasteSpecial Paste:=xlPasteValues
WS1.Range(WS1.Cells(c.Row, "E"), WS1.Cells(c.Row, "K")).Copy
WS2.Cells(lr2, "E").PasteSpecial Paste:=xlPasteValues
lr2 = WS2.Cells(WS2.Rows.Count, "B").End(xlUp).Row + 1
c.Value = "Exported"
End If
Next c
Application.ScreenUpdating = True
Application.CutCopyMode = False
End Function