[AccessD] Programmatically change cell formulae in Ecel

Jurgen Welz jwelz at hotmail.com
Wed Nov 28 14:17:06 CST 2007


Arthur:
 
Here is an example from code I use where M refers to a named range cell in a sheet:
 
                .Cells(14, 4).Select                .ActiveCell.FormulaR1C1 = "=IF(M=0,Tender!RC[-1],Tender!RC[-1]*Tender!RC[11])"CiaoJürgen WelzEdmonton, Albertajwelz at hotmail.com> Date: Wed, 28 Nov 2007 15:10:24 -0500> From: fuller.artful at gmail.com> To: dba-tech at databaseadvisors.com; accessd at databaseadvisors.com> Subject: [AccessD] 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> -- > AccessD mailing list> AccessD at databaseadvisors.com> http://databaseadvisors.com/mailman/listinfo/accessd> Website: http://www.databaseadvisors.com
_________________________________________________________________
Are you ready for Windows Live Messenger Beta 8.5 ? Get the latest for free today!
http://entertainment.sympatico.msn.ca/WindowsLiveMessenger


More information about the AccessD mailing list