i have an access application in which i need to open an existing excel sheet, find a date (already in the sheet) and populate a row (with the date cell column) with either 1 or 0
this means i have to convert the datecell.column to the alphabet equivalent before i can set a cell to be populated.
I used a function, which i have used in excel before (as seen below)
Expand|Select|Wrap|Line Numbers
- Function Col_Letter(lngcol) As String
- Dim vArr
- vArr = Split(Cells(1, lngcol).Address(True, False), "$")
- Col_Letter = vArr(0)
- End Function
i have tried more explicit methods of referring to the cell... seeing as i am working with excel from assess, but non has worked.
i tried
Expand|Select|Wrap|Line Numbers
- Function Col_Letter(lngcol) As String
- Dim vArr
- With Worksheets("August2013")
- vArr = Split(Cells(1, lngcol).Address(True, False), "$")
- Col_Letter = vArr(0)
- End With
- End Function
Expand|Select|Wrap|Line Numbers
- Function Col_Letter(lngcol) As String
- Dim vArr
- With Worksheets(1)
- vArr = Split(Cells(1, lngcol).Address(True, False), "$")
- Col_Letter = vArr(0)
- End With
- End Function
Expand|Select|Wrap|Line Numbers
- Function Col_Letter(lngcol) As String
- Dim vArr
- With Sheets(1)
- vArr = Split(Cells(1, lngcol).Address(True, False), "$")
- Col_Letter = vArr(0)
- End With
- End Function
Expand|Select|Wrap|Line Numbers
- Function Col_Letter(lngcol) As String
- Dim vArr
- vArr = Split(Sheets(1).Cells(1, lngcol).Address(True, False), "$")
- Col_Letter = vArr(0)
- End Function
Expand|Select|Wrap|Line Numbers
- Function Col_Letter(lngcol) As String
- Dim vArr
- Dim app As New Excel.Application
- app.Visible = True
- Dim Book As Excel.Workbook
- Set Book = app.Workbooks.Add("D:\...\timesheeteng.xlsm")
- With Book.Worksheets("August2013")
- vArr = Split(Cells(1, lngcol).Address(True, False), "$")
- Col_Letter = vArr(0)
- End With
- End Function
Any idea what i doing wrong?