VBA for Excel Code (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


accessman -> VBA for Excel Code (7/9/2006 15:14:25)

Hi,

I write VBA in MS Access

.Worksheets(3).cells(p,i) = 1
.Worksheets(3).cells(p+1,i) = 2
.Worksheets(3).cells(p+2,i) = 3

.Worksheets(3).cells(p+3,i).formula = "=Sum(" & .Worksheets(3).Cells(p, i) & ":" & .Worksheets(3).Cells(p+2, i) & ")"


But, the sum function doesn't work, because it only get the cells value, it needs cells name (eg. B2, B3, ...etc).

I want to use cells(p,i) to represent, because I make the variable column, and rows depend on the input parameters.

Please let me know, thanks.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
4.736328E-02