Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, I have a problem in a recordset.
I recover of the data since Access and I insert my data in Excel. I place my data in A11 for example and imagine that my data go from A11 to R51. With each time, in my column A with last the recordings it me insert not data but the number of the line, in this case 51. I have only this problem that in a cell and the first column of my last recording. Could you help me?. This is my code Public Sub CopyFromRecordset() Dim Db1 As Database Dim Rs1 As Recordset, Nb As Long Dim Sh As Worksheet, Rg As Range, Nl As Range Dim Chemin As String, Fichier As String Dim bordure As MsoLineStyle bordure = msoLineSingle Set Sh = Worksheets("Test") With Sh Set Rg = .Range("A10") End With Set Db1 = DBEngine.OpenDatabase(ThisWorkbook.Path & "\GeneralReport.mdb") Set Rs1 = Db1.OpenRecordset("REPORT", dbOpenDynaset) Rg.CurrentRegion.Clear If Rs1.EOF = False Then Nb = Rs1.Fields.Count - 1 For a = 0 To Nb Rg(, 1 + a) = Rs1.Fields(a).Name Next Rg.Resize(, Nb + 1).Font.Bold = True Rg.Resize(, Nb + 1).Interior.ColorIndex = 15 Rg.Offset(1).CopyFromRecordset Rs1 Else MsgBox("No Record") End If After I kill the object .... Thanks for your help Keawee ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro code to put series name next to individual line in line grap | Charts and Charting in Excel | |||
Excel 2007 Line Graph, Data Table, Number Formatting | Charts and Charting in Excel | |||
If statement to replace #VALUE! code | Excel Worksheet Functions | |||
Graphically display data on a number line | Charts and Charting in Excel | |||
Combination Bar/Line chart---each with different number of data points | Charts and Charting in Excel |