[dba-Tech] Programmatically change cell formulae in Ecel

Rusty Hammond rustykh at yahoo.com
Wed Nov 28 14:16:59 CST 2007


how about Range("E6").value = strFormula

----- Original Message ----
From: Arthur Fuller <fuller.artful at gmail.com>
To: Discussion of Hardware and Software issues <dba-tech at databaseadvisors.com>; Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Sent: Wednesday, November 28, 2007 2:10:24 PM
Subject: [dba-Tech] Programmatically change cell formulae in Ecel


Sorry for the double-post but I'm desperate.

I'm trying to change cell formulae in Excel using VBA code and am
 running
into two different problems (well, maybe problem 2 will disappear when
 I
figure out problem 1).

I have a string stored like this:

Dim strFormula as String
strFormula "=VLOOKUP(A6,'S:\Lgroup\Fundacct\Excel\!INVPORT\CSV
 Files\Sep
07\[# of securities.xls]SOI'!$B$3:$C$100,2,TRUE)"

I am trying to assign it to the formula of a cell like this:

Range("E6").Formula = strFormula


What happens is that it gets pasted in as text, NOT as the formula. I
 tried
removing the equals sign and assigning the rest to the formula of the
 cell,
but that didn't work either.

I'm way behind on a deadline and I have to get this working. Any
 assistance
greatly appreciated!

TIA,
Arthur
_______________________________________________
dba-Tech mailing list
dba-Tech at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-tech
Website: http://www.databaseadvisors.com





      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs



More information about the dba-Tech mailing list