Adodb.recordset issue with column containing numbers and numbers formatted as text

uk747

Well-known Member
Joined
Jul 20, 2011
Messages
832
Office Version
  1. 365
Platform
  1. Windows
Have a column in closed workbook.

Some are numbers and some are numbers but formatted as text, even though the column is formatted as general

When I use my adodb.recordset to get the data, all the data is fine, except the column with numbers

All the numbers come through, but the ones formatted as text come through blankdoesnt happen every time but frustrating when it does. Is ther a setting which will do all


E.g.
123
123
456
456

Will come through as
123

456

also even tried
1
2
3
a
b
c
4
5
6

Which came through as

1
2
3


4
5
6
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Not real clear to me what you're doing (looping through a recordset?). Then maybe try IsNumeric function on each value - but do what if true and do what if false? Or ignore because I'm way off base with the requirement and issue... :unsure:
 
Upvote 0
Want to transfer all data from MYDATA sheet including columns that contain a mix of numbers and text or numbers formatted as text. I.e. 123, abc or something like 123-567-788

VBA Code:
Rs.open "SELECT * FROM [MYDATA] ", con

Thisworkbook.sheets("sheet2").range("D8").copyfromrecordset rs
 
Upvote 0
ADODB is not my thing, so I'll have to leave this to someone else, but I have to wonder why you don't just copy and paste the range or use TransferSpreadSheet function.
 
Upvote 0
Umm, you've heard of Google right?
Look for TransferSpreadSheet function, not transfer spreadsheetfunction. The details are fairly extensive and are not conducive to answering that question here. Perhaps it doesn't even apply to what you're doing.
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,799
Members
449,337
Latest member
BBV123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top