Reference a Single spreadsheet cell

captnk

Registered User.
Local time
Today, 20:12
Joined
Dec 12, 2001
Messages
148
Is it possible to reference a single spreadsheet cell (XL) from a form field.

I want to change a percentage figure in the spreadsheet figure directly from a (textbox?) field on a form,so that the spreadsheet calculates the new percentages.
I dont want to import or export the spreadsheet data,i can already do that.

The spreadshheet is located in the same directory as the Db,but is not otherwise linked or joined
 
captnk,

Yes, however I'm on a laptop without Access.

I will post you an example on Monday when I get back to work.

I just tried the search here and it hung, but you can probably
search for "Cell" and you should see some examples.

Wayne
 
Wayne
Tks,i looked under cells also under hyperlinks.
thats stuff i s close but not quite what i want,(Or im missing the point on its application)
So if u could post up the example it would be appreciated
 
captnk,

Here is a little excerpt ...

Make sure to set the Excel reference.

Code:
Dim app As Excel.Application
Dim wb As Excel.Workbook
Dim sht As Excel.Worksheet
Dim rng As Excel.Range

Set app = CreateObject("Excel.Application")
app.Visible = True
Set wb = app.Workbooks.Add
Set sht = wb.ActiveSheet

sht.Cells(3, 1) = "Heading"
sht.Cells(3, 2) = "Something"
sht.Cells(3, 3) = "Something"
sht.Cells(3, 4) = "Something"
sht.Cells(3, 5) = "Something"

sht.Cells(RowCtr + 4, 5) = STR(Int((FrameTotals(1) + FrameTotals(2) + FrameTotals(3)) / 60))

Set rng = sht.Range("A1", "E15")
rng.EntireColumn.AutoFit

Wayne
 

Users who are viewing this thread

Back
Top Bottom