![]() |
|
تصدير عمود معين - نسخة قابلة للطباعة +- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb) +-- قسم : قسم لغات البرمجة الاخرى (http://vb4arb.com/vb/forumdisplay.php?fid=4) +--- قسم : قسم لغة vb6.0 (http://vb4arb.com/vb/forumdisplay.php?fid=18) +--- الموضوع : تصدير عمود معين (/showthread.php?tid=28853) |
تصدير عمود معين - حامد محمد - 05-03-19 On Error Resume Next Dim oExcel As Excel.Application Dim oWB As Excel.Workbook Dim xlsheet As Excel.Worksheet Set oExcel = New Excel.Application Dim xlsFileName As String xlsFileName = App.Path & "\Data.xls" Dim oRng1 As Excel.Range Dim oRng2 As Excel.Range Dim row0, col0, icol, irow As Integer Set oWB = oExcel.Workbooks.add Set xlsheet = oWB.Worksheets(1) For row0 = 1 To MSHFlexGrid1.Rows - 1 For col0 = 0 To MSHFlexGrid1.Cols - 1 If MSHFlexGrid1.ColWidth(col0) > 0 Then xlsheet.Cells(row0 + 1, col0 - 0).Value = MSHFlexGrid1.TextMatrix(row0, col0) xlsheet.Cells(row0 + 1, col0 - 0).Font.Name = "Tahoma" xlsheet.Cells(row0 + 1, col0 - 0).Font.Bold = False: xlsheet.Cells(row0 + 1, col0 - 0).Font.Size = 11: xlsheet.Columns(col0).AutoFit End If Next Next oExcel.Visible = True Set oWB = Nothing Set oExcel = Nothing KewlButtons6.Enabled = True[/code] ازاي من هذا الكود اصدر عمود واحد الى الاكسل ويكون في العمود A 'MSHFLEXGRID عن طريقها ارجو التعديل في الكود RE: تصدير عمود معين - حامد محمد - 06-03-19 بارك الله فيك ...لكن بيتصدر في العمود E من الاكسل عايزه يتصدر في الاكسل العمود A |