beantownmt
New Member
- Joined
- Aug 29, 2011
- Messages
- 11
Hi All.
I'm Having a problem with getting my Macro to auto update my field calculations once items are imported from Sheet1 to Sheet2
Here's the Code I'm using.
This Works Correctly
Application.EnableEvents = False
r = rngCell.Row
'u = Sheets("JeffsTransp").Range("B" & Rows.Count).End(xlUp).Row + 1
Sheets("JeffsTransp").Rows(u & ":" & u).Insert Shift:=xlDown
Sheets("JeffsTransp").Range("B" & u) = Sheets("Sheet1").Range("B" & r)
Sheets("JeffsTransp").Range("D" & u) = Sheets("Sheet1").Range("K" & r)
Sheets("JeffsTransp").Range("E" & u) = Sheets("Sheet1").Range("C" & r)
Sheets("JeffsTransp").Range("F" & u) = Sheets("Sheet1").Range("D" & r)
Sheets("JeffsTransp").Range("G" & u) = Sheets("Sheet1").Range("E" & r)
Sheets("JeffsTransp").Range("H" & u) = Sheets("Sheet1").Range("F" & r)
Sheets("JeffsTransp").Range("J" & u) = Sheets("Sheet1").Range("G" & r)
Sheets("JeffsTransp").Range("K" & u) = Sheets("Sheet1").Range("H" & r)
Sheets("JeffsTransp").Range("L" & u) = Sheets("Sheet1").Range("N" & r)
Sheets("JeffsTransp").Range("O" & u) = Sheets("Sheet1").Range("I" & r)
Sheets("JeffsTransp").Range("S" & u) = Sheets("Sheet1").Range("L" & r)
Application.EnableEvents = True
u = u + 1
'rngStart.PasteSpecial (xlPasteValuesAndNumberFormats)
Next rngCell
'restore screen updating
MsgBox "Limo Wiz Records to be Imported = " & n
I can not get these calculations to work after fields are imported
Cells(Target.Row, 1).Formula = "=A4+A15+1" 'Auto Line Number
Cells(Target.Row, 14).Formula = "=K16*L16" 'Gratutity Calculation
Cells(Target.Row, 16).Formula = "=K16+N16" 'Gross Recpts w Grats
Cells(Target.Row, 18).Formula = "=SUM(K16+O16)*Q16" 'Lease Rate
Cells(Target.Row, 20).Formula = "=R16*S16" 'Sales Tax Due
Cells(Target.Row, 21).Formula = "=SUM(P16-R16-T16)+M16" 'Exchange back with Grat
Application.ScreenUpdating = True
Exit Sub
Any help would be gratly appreciated.
I'm Having a problem with getting my Macro to auto update my field calculations once items are imported from Sheet1 to Sheet2
Here's the Code I'm using.
This Works Correctly
Application.EnableEvents = False
r = rngCell.Row
'u = Sheets("JeffsTransp").Range("B" & Rows.Count).End(xlUp).Row + 1
Sheets("JeffsTransp").Rows(u & ":" & u).Insert Shift:=xlDown
Sheets("JeffsTransp").Range("B" & u) = Sheets("Sheet1").Range("B" & r)
Sheets("JeffsTransp").Range("D" & u) = Sheets("Sheet1").Range("K" & r)
Sheets("JeffsTransp").Range("E" & u) = Sheets("Sheet1").Range("C" & r)
Sheets("JeffsTransp").Range("F" & u) = Sheets("Sheet1").Range("D" & r)
Sheets("JeffsTransp").Range("G" & u) = Sheets("Sheet1").Range("E" & r)
Sheets("JeffsTransp").Range("H" & u) = Sheets("Sheet1").Range("F" & r)
Sheets("JeffsTransp").Range("J" & u) = Sheets("Sheet1").Range("G" & r)
Sheets("JeffsTransp").Range("K" & u) = Sheets("Sheet1").Range("H" & r)
Sheets("JeffsTransp").Range("L" & u) = Sheets("Sheet1").Range("N" & r)
Sheets("JeffsTransp").Range("O" & u) = Sheets("Sheet1").Range("I" & r)
Sheets("JeffsTransp").Range("S" & u) = Sheets("Sheet1").Range("L" & r)
Application.EnableEvents = True
u = u + 1
'rngStart.PasteSpecial (xlPasteValuesAndNumberFormats)
Next rngCell
'restore screen updating
MsgBox "Limo Wiz Records to be Imported = " & n
I can not get these calculations to work after fields are imported
Cells(Target.Row, 1).Formula = "=A4+A15+1" 'Auto Line Number
Cells(Target.Row, 14).Formula = "=K16*L16" 'Gratutity Calculation
Cells(Target.Row, 16).Formula = "=K16+N16" 'Gross Recpts w Grats
Cells(Target.Row, 18).Formula = "=SUM(K16+O16)*Q16" 'Lease Rate
Cells(Target.Row, 20).Formula = "=R16*S16" 'Sales Tax Due
Cells(Target.Row, 21).Formula = "=SUM(P16-R16-T16)+M16" 'Exchange back with Grat
Application.ScreenUpdating = True
Exit Sub
Any help would be gratly appreciated.