Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Trying to write vba code to import another spreadsheet...

I know this is simple, but it's not working for me. When I import another
spreadsheet a number of column names are not imported. The columns are not
on the first row. The first column being 'employee id'. I also tried
transferspreadsheet command, but my code isn't even recognizing the docmd.
Any hints?
--
Otium Cum Dignatate
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 59
Default Trying to write vba code to import another spreadsheet...


"joep3" wrote in message
...
I know this is simple, but it's not working for me. When I import another
spreadsheet a number of column names are not imported. The columns are

not
on the first row. The first column being 'employee id'. I also tried
transferspreadsheet command, but my code isn't even recognizing the docmd.
Any hints?
--
Otium Cum Dignatate


Why not import the entire sheet rather than a subsection?

<snip
Worksheets.Add , Count:=1
Workbooks.Open FileName:="full path of filename to copy", ReadOnly:=True
Cells.Select: Selection.Copy
ThisWorkbook.Sheets("Sheet4").Activate: ActiveSheet.Paste
Workbooks("file opened above").Close savechanges:=False
<snip


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Trying to write vba code to import another spreadsheet...

Hi thanks for getting back to me!

The reason the header is missing in some instances is that the header
doesn't match the data type that the column is under. I am importing the
whole sheet, using the Import data routine and recording that then editing
the recorded call for a procedure. The issue, however, is still unresolved.
I am receiving an unknown sheet with certain columns I am to find and filter
out. The columns are not garanteed to be in the first column. ( the columns
are imported corectly if this is true.) So, how do I tell the import to
import the whole sheet in text, so all the column names are imported. I can
do the conversion myself.
--
Otium Cum Dignatate


"Jef Gorbach" wrote:


"joep3" wrote in message
...
I know this is simple, but it's not working for me. When I import another
spreadsheet a number of column names are not imported. The columns are

not
on the first row. The first column being 'employee id'. I also tried
transferspreadsheet command, but my code isn't even recognizing the docmd.
Any hints?
--
Otium Cum Dignatate


Why not import the entire sheet rather than a subsection?

<snip
Worksheets.Add , Count:=1
Workbooks.Open FileName:="full path of filename to copy", ReadOnly:=True
Cells.Select: Selection.Copy
ThisWorkbook.Sheets("Sheet4").Activate: ActiveSheet.Paste
Workbooks("file opened above").Close savechanges:=False
<snip



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Trying to write vba code to import another spreadsheet...

Thanks Jeff,
I replied before tryiing your code. It works. Thanks!

--
Otium Cum Dignatate


"Jef Gorbach" wrote:


"joep3" wrote in message
...
I know this is simple, but it's not working for me. When I import another
spreadsheet a number of column names are not imported. The columns are

not
on the first row. The first column being 'employee id'. I also tried
transferspreadsheet command, but my code isn't even recognizing the docmd.
Any hints?
--
Otium Cum Dignatate


Why not import the entire sheet rather than a subsection?

<snip
Worksheets.Add , Count:=1
Workbooks.Open FileName:="full path of filename to copy", ReadOnly:=True
Cells.Select: Selection.Copy
ThisWorkbook.Sheets("Sheet4").Activate: ActiveSheet.Paste
Workbooks("file opened above").Close savechanges:=False
<snip



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I import data from a closed Excel Spreadsheet? Tomcat Excel Discussion (Misc queries) 2 May 30th 06 12:51 PM
Import data to a spreadsheet. Bethany L Excel Discussion (Misc queries) 1 February 3rd 06 05:04 PM
Can i see code and spreadsheet simultaneously Stuart New Users to Excel 1 August 26th 05 03:34 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
Write code to insert multiple lines Frantic Excel-er Excel Discussion (Misc queries) 0 June 17th 05 12:13 AM


All times are GMT +1. The time now is 12:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"