Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problem importing using MS Query

Don,
I inserted your macro and got the same results.
Phil

-----Original Message-----
The code you presented only copies a4:c4 down. after

refreshall
try using this from any worksheet (Input worksheet I

guess)

Sub copydn()
ActiveWorkbook.RefreshAll
[header!a4].Copy Destination:=[header!a5:a1502]
[detail!a4:c4].Copy Destination:=[detail!a5:c2036]
msgbox "DONE"
End Sub

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Phil" wrote in message
...
Sub RefreshData()
'
' RefreshData Macro
' Macro recorded 8/21/2001 by pkoops
'

'
ActiveWorkbook.RefreshAll
Sheets("Header").Select
Range("A4").Select
Selection.Copy
Range("A4:A1502").Select
ActiveSheet.Paste


Sheets("Detail").Select
Range("b4").Select
Selection.Copy
Range("b5:b2036").Select
ActiveSheet.Paste
Range("c4").Select
Selection.Copy
Range("c5:c2036").Select
ActiveSheet.Paste


Range("a4").Select
Selection.Copy
Range("a5:a2036").Select
ActiveSheet.Paste
Range("A3").Select
Sheets("Input").Select
Range("d1").Select
'MsgBox "All Data Files were successfully

Refreshed",
vbExclamation, "Refresh Data Complete"
End Sub

-----Original Message-----
You could post your code (NOT workbook) for comments.

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Phil" wrote in message
...
I have a spreadsheet that imports data (open orders)

from
our ODBC capable accounting package. When the data

is
imported the order number is imported as a text field
instead of a number (which is the format I need).

This
may be because our accounting software adds leading

zeros
to complete a 7 digit field. Because the spreadsheet
requires a value of the order number I import the

data
starting in column B of excel and in column A I use

the
=value() function to convert the order number to a
number. The problem comes when I actually import the
data. The formulas in column A get changed only at

the
end of the record set (example: I Import 50 records

and
1-
45 are fine value(B1), value(B2),...until about

record
45
where it skips ahead several records - value(B44),

value
(B45), value(B58) value value (59), etc...). I

couldn't
solve this so I added a macro to import the data and

added
at the end of the macro a function to re-establish

the
formulas in column A. This seemed to work, but

after a
few uses the macro fix doesn't work. If i go in and

copy
the formulas down manually it works again, but I

don't
want to do that each time.

Any advice?

Thanks
Phil


.



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Problem importing using MS Query

Then, I am going to assume that is it somewhere in the refresh part because
all the rest of this macro is doing is copying cells down...... Try without
the copy parts. At least I have helped you on that part of it.

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Phil" wrote in message
...
Don,
I inserted your macro and got the same results.
Phil

-----Original Message-----
The code you presented only copies a4:c4 down. after

refreshall
try using this from any worksheet (Input worksheet I

guess)

Sub copydn()
ActiveWorkbook.RefreshAll
[header!a4].Copy Destination:=[header!a5:a1502]
[detail!a4:c4].Copy Destination:=[detail!a5:c2036]
msgbox "DONE"
End Sub

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Phil" wrote in message
...
Sub RefreshData()
'
' RefreshData Macro
' Macro recorded 8/21/2001 by pkoops
'

'
ActiveWorkbook.RefreshAll
Sheets("Header").Select
Range("A4").Select
Selection.Copy
Range("A4:A1502").Select
ActiveSheet.Paste


Sheets("Detail").Select
Range("b4").Select
Selection.Copy
Range("b5:b2036").Select
ActiveSheet.Paste
Range("c4").Select
Selection.Copy
Range("c5:c2036").Select
ActiveSheet.Paste


Range("a4").Select
Selection.Copy
Range("a5:a2036").Select
ActiveSheet.Paste
Range("A3").Select
Sheets("Input").Select
Range("d1").Select
'MsgBox "All Data Files were successfully

Refreshed",
vbExclamation, "Refresh Data Complete"
End Sub

-----Original Message-----
You could post your code (NOT workbook) for comments.

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Phil" wrote in message
...
I have a spreadsheet that imports data (open orders)
from
our ODBC capable accounting package. When the data

is
imported the order number is imported as a text field
instead of a number (which is the format I need).

This
may be because our accounting software adds leading
zeros
to complete a 7 digit field. Because the spreadsheet
requires a value of the order number I import the

data
starting in column B of excel and in column A I use

the
=value() function to convert the order number to a
number. The problem comes when I actually import the
data. The formulas in column A get changed only at

the
end of the record set (example: I Import 50 records

and
1-
45 are fine value(B1), value(B2),...until about

record
45
where it skips ahead several records - value(B44),

value
(B45), value(B58) value value (59), etc...). I

couldn't
solve this so I added a macro to import the data and
added
at the end of the macro a function to re-establish

the
formulas in column A. This seemed to work, but

after a
few uses the macro fix doesn't work. If i go in and
copy
the formulas down manually it works again, but I

don't
want to do that each time.

Any advice?

Thanks
Phil


.



.



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
Importing Union Query Nightshade Excel Discussion (Misc queries) 1 September 28th 07 05:54 PM
Importing access query dany Excel Discussion (Misc queries) 3 March 23rd 07 11:55 AM
Importing Access Query help Excel Discussion (Misc queries) 3 August 24th 06 06:16 PM
Importing Data via Web Query - Can values be passed to query? [email protected] Excel Discussion (Misc queries) 5 May 9th 06 06:21 PM
Importing a table from Access query Trish Excel Discussion (Misc queries) 1 May 12th 05 08:44 AM


All times are GMT +1. The time now is 09:41 AM.

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

About Us

"It's about Microsoft Excel"