Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
It got to this line "Col2Write = Trim(CStr(MyCell.Col + ColOffset))" and stalled with error "object doesnt support this method or property" I'm relatively new to vba Could you advise further ? Alan "Nicholas B" wrote: Sorry There's another option Excel can read DBF's directly as long as there are less records than rows in Excel So you could open the file and read in the data then transfer it toi where you want it This is just iffy code not totally correct syntax ... just to give you starting points OriginalWB = ActiveWorkBook.Name OriginalSht = ActiveSheet.Name RowOffset = 10 ' Set to something that works for the location of your data ColOffset = 10 ' Set to something that works for the location of your data ListofCols = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" Application.WorkBooks.Open("C:\YourDataFolder\Your DBF.DBF") FOR EACH MyCell in Activesheet.Cells Row2Write = Trim(CStr(MyCell.Row+RowOffset)) Col2Write = Trim(CStr(MyCell.Col+ColOffset)) Cell2Write = MID(ListofCols,Col2Write,1)+Trim(STR(Row2Write)) IF MyCell.Row1 then ' The field headers are in row 1 IF MyCell.Column = 1 then WorkBooks(OriginalWB).Sheets(OriginalSht).Range(Ce ll2Write).Formula = MyCell.Value ENDIF IF MyCell.Column = 2 then WorkBooks(OriginalWB).Sheets(OriginalSht).Range(Ce ll2Write).Formula = MyCell.Value ENDIF ENDIF NEXT MyCell Well that sort of approach ! Good luck Nick "Alan" wrote: Hi, Im looking for some vba code that I could apply to a button, which when clicked, will then import specific tables from a dbase file, starting at a specific cell on Excel spreadsheet. Appreciate any advice you can give €“ Thanks Alan. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to Start Excel in Text Import Wizard for data import | Setting up and Configuration of Excel | |||
PLEASE!! How can I un-grey the 'Data-Import External Data-Import Data' option ??? | Excel Programming | |||
autofill data from excell dbase into html form offline? | Excel Programming | |||
Excel VBA & ADO - retreiving data from Approach dBase IV .dbf files | Excel Programming | |||
sending data to an MS-SQL dbase | Excel Programming |