Calculation of Multiple Cells after Import

Status
Not open for further replies.

beantownmt

New Member
Joined
Aug 29, 2011
Messages
11
Hi all.
I have a macro to import data from sheet1 to JeffsTransp.
The Data imports fine and the calculation works. The only problem is the calculations will only work on the first row of data? How can I get the calculations to work on all the imported data.
Here's the code I'm using;
Copy and Paste Code
'B=B C=C D=D E=E F=L G=E H=F I=G K=H L=I M=J N=O T=M.
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("C" & u) = Sheets("Sheet1").Range("C" & r)
Sheets("JeffsTransp").Range("D" & u) = Sheets("Sheet1").Range("D" & r)
Sheets("JeffsTransp").Range("F" & u) = Sheets("Sheet1").Range("L" & r)
Sheets("JeffsTransp").Range("G" & u) = Sheets("Sheet1").Range("E" & r)
Sheets("JeffsTransp").Range("H" & u) = Sheets("Sheet1").Range("F" & r)
Sheets("JeffsTransp").Range("I" & u) = Sheets("Sheet1").Range("G" & r)
Sheets("JeffsTransp").Range("K" & u) = Sheets("Sheet1").Range("H" & r)
Sheets("JeffsTransp").Range("L" & u) = Sheets("Sheet1").Range("I" & r)
Sheets("JeffsTransp").Range("M" & u) = Sheets("Sheet1").Range("J" & r)
Sheets("JeffsTransp").Range("N" & u) = Sheets("Sheet1").Range("O" & r)
Sheets("JeffsTransp").Range("T" & u) = Sheets("Sheet1").Range("M" & r)
Application.CalculateFull
Application.EnableEvents = True
u = u + 1

'rngStart.PasteSpecial (xlPasteValuesAndNumberFormats)

Next rngCell
'restore screen updating

MsgBox "Limo Wiz Trips to be Imported = " & n
Application.EnableEvents = False
Application.Calculation = xlAutomatic

Range("A16").Formula = "=A4+A15+1"
Range("O16").Formula = "=L16*N16"
Range("Q16").Formula = "=L16+O16"
Range("S16").Formula = "=SUM(L16+M16)*R16"
Range("U16").Formula = "=S16*T16"
Range("V16").Formula = "=SUM(Q16-S16-U16)+P16"
Application.CalculateFull
Application.EnableEvents = True

Application.ScreenUpdating = True
Exit Sub
'error handler
ErrHnd:
' ErrClear
'restore screen updating
Application.ScreenUpdating = True
End Sub

Any Help will be greatly appreciated
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Status
Not open for further replies.

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top