View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Thomas Ramel Thomas Ramel is offline
external usenet poster
 
Posts: 70
Default Fastest way to enter many formulas

Grüezi ob3ron02

ob3ron02 schrieb am 27.10.2004

I've got a database query filling column B-F of a worksheet (no blanks)
with a variable number of rows (but usually many rows). I'm trying to
determine the quickest method to fill column A with a formula that
depends on the row's column B value.
--------------------
Dim LastRow As Integer
LastRow = Worksheets("Data").Range("B1").End(xlDown).Row

Do While counter < LastRow
Worksheets("Data").Range("A2").Offset(counter, 0).Formula = DataIdentifier
Counter = Counter + 1
Loop
--------------------


I don't know what 'DataIdentifier' is; did you define this value or formula
earlier in your code?

Question 3) Does anyone have any suggestions for other ways to optimize
this process?


You might try this one:

Dim LastRow As Long 'if more than 32767 rows
LastRow = Worksheets("Data").Range("B1").End(xlDown).Row

Worksheets("Data").Range("A2:A"&LastRow).Formula = DataIdentifier

--
Regards

Thomas Ramel
- MVP for Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]