Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am programatically brining in data to a range of cells in a worksheet. The way I am doing this is connecting to SQL Server and assigning the results to a range of cells. The problem I have is that when the data is placed into the worksheet, it highlights all of the cells blue. I cannot figure out what is going this. I don't want it to change colors, or anything like that. I just want the data placed in the worksheet. Any ideas as to what is happening? The code which retrieves the data is below. Thank you in advance Dim sda As New SqlDataAdapter(cmd) lagData = New DataSet sda.Fill(lagData) Dim dt As DataTable = lagData.Tables(0) rowCount = dt.Rows.Count + 6 Dim strRange As String = "D6" rngList = DirectCast(lagDataWS.Range(strRange), Excel.Range) rngList = rngList.Resize(dt.Rows.Count + 1, dt.Columns.Count) rngList.Value2 = Me.ConvertDataTableToArray(dt) Dim lo As Excel.ListObject lo = lagDataWS.ListObjects.AddEx(Excel.XlListObjectSour ceType.xlSrcRange, rngList, , Excel.XlYesNoGuess.xlYes) lo.Name = "blah" rngList.Columns.AutoFit() lagDataWS.Activate() -- Thanks, Scott |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell Coloring | Excel Discussion (Misc queries) | |||
Cell coloring | Excel Discussion (Misc queries) | |||
Cell Coloring | Excel Worksheet Functions | |||
Excel to Outlook VBA giving my Calendar Fits | Excel Programming | |||
Detecting if a value "fits" in a cell. | Excel Programming |