Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 19th, 2005, 02:28 AM
aem aem is offline
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA SQL import from Excel number format

Hi, I am creating an SQL Recordset of a data table from an external Excel spreadsheet. I am importing this into another spreadsheet using WHERE and ORDER filters...no problems there. The first column of my import contains only integers, when I try a simple VLOOKUP or MATCH Excel command on this first column I get #N/A because the imported data is not in number format.
The code Im using to dump the record set to the worksheet is as follows:

rsData.Filter = "Status LIKE 'Open'"
   ActiveSheet.Range("A2").CopyFromRecordset rsData

I need guidance on massaging the first column only of the recordset (field?) to force it to an integer or number format so any subsequent operations in Excel using lookups on those numbers will not return an error.
Any thoughts?
MJ






Similar Threads
Thread Thread Starter Forum Replies Last Post
import from excel to sql database manigandan C# 2 March 5th, 2010 05:34 AM
Excel format changes from Number to Text ajindal General .NET 2 July 24th, 2007 06:56 AM
Save a file in CSV format thru Excel VBA macro roli2712 Excel VBA 1 July 11th, 2007 03:05 AM
import data from text file to excel(VBA) topr Excel VBA 2 August 26th, 2004 11:36 PM
Excel VBA to SQL & back to VBA edesousa Excel VBA 1 June 1st, 2004 02:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.