where are you copying your data from?
second, are those formulas there just in case you have 10,000 rows of data? that's a lot of formulas. most of the excel funtions are supported in VBA, and the ones that aren't have corresponding functions in VBA.
There's several different ways to skin this cat, and I'm gonna guess you have no experience with programming in VBA.
Since i have no idea what you're doing as far as data calculations, here's a sample spreadsheet:
Item Date ordered Qty Price Anticpated Item total
delivery date
Extenze 6/9/69 5 10
The anticipated delivery date and the item total will be calculated fields.
So here's the code:
Code:
Option Explicit
Sub GoDownRows()
Dim Rg As Range 'Declare an object variable that is a range object
Dim lRowOffset As Long 'this is a variable to keep track of which row we're in.
Set Rg = Sheets("Sheet1").Range("A1") 'Change "Sheet1" to whatever the name of your sheet is
With Rg
'____________________________________________________________________________________________________________________________________
'Use the offset property of the Range object to refer to the cell you want to put a calculated result in. The Offset property is
'zero-based, so since we've set our range to be cell "A1", then ".Offset(0, 0)" refers to "A1". The first zero is the
'row offset, the second is the column offset, so ".Offset(1,0)" refers to cell "A2", ".Offset(0,1)" refers to cell "B1", and
'so on.
'Because we are within a "With/End With" block, precede the offset property with a period.
'I'm going to assume you paste your data into cell "A2" of your worksheet, so as we go down the columns, we'll check the "A"
'column to see if we should enter formulas for this row.
'___________________________________________________________________________________________________________________________________
lRowOffset = 1 'Set the row number to 2, the one directly under your column headers. Keep in mind that because the offset is
'zero-based, it's gonna be one less the the actual row we're looking at.
Do Until IsEmpty(.Offset(lRowOffset, 0)) 'if there's data pasted into this row in the "A" column, do it, otherwise exit this loop.
.Offset(lRowOffset, 4) = .Offset(lRowOffset, 1) + 6 'Add six days to the order date to come up with the delivery date
'multiply the quantity ordered by the price and enter it into column "F"
.Offset(lRowOffset, 5) = .Offset(lRowOffset, 2) * .Offset(lRowOffset, 3)
lRowOffset = lRowOffset + 1 'Go to the next row
Loop 'go back to the "Do Until" line
End With
Set Rg = Nothing 'Free up your computer's memory
End Sub
Assuming you know nothing of coding, there's a lot i've left out. Don't want to write a book, lol. If you need to use an Excel function, the code would look something like this:
Code:
.Offset(lRowOffset, 6) = WorksheetFunction.VLookup("Extenze", Range("Prices"), 4, False) 'Where "Prices" is a named range that has Item names and prices
Hope that helps, if not, post again.