Hale, Jim
Jim.Hale at FleetPride.com
Wed Feb 1 10:35:55 CST 2006
Is this what you are looking for? 'flip sign on vendor rebates '--------------------------- .Sheets("misc").Select For i = 6 To 11 .Cells(25, i) = -(.Cells(25, i)) Next i Or something like this? Jim Hale Function loadData_Excel(Dept As Integer, Co As Integer, ModelName As String, XcelWS As String, PlGroup As String, qryStr As String) Dim qdfTemp As QueryDef, dbs As Database, rs As Recordset Dim intRow As Integer, intBmonth As Integer, strWorksheet As String 'load data from recordset into spreadsheet Set dbs = CurrentDb Set qdfTemp = dbs.QueryDefs(qryStr) qdfTemp.Parameters("Deptnum") = Dept qdfTemp.Parameters("Co") = Co qdfTemp.Parameters("Model") = ModelName qdfTemp.Parameters("Worksheet") = XcelWS qdfTemp.Parameters("PlGroup") = PlGroup Set rs = qdfTemp.OpenRecordset() If Not (rs.BOF And rs.EOF) Then strWorksheet = rs("fldWorksheet") appexcel.Sheets(strWorksheet).Select Do While Not rs.EOF intBmonth = rs("Bmonth") + rs("fldColumnoffset") intRow = rs("fldRowno") appexcel.Cells(intRow, intBmonth) = rs("amt") rs.MoveNext Loop End If The_End: If Not (qdfTemp Is Nothing) Then qdfTemp.Close: Set qdfTemp = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing If Not (dbs Is Nothing) Then dbs.Close: Set dbs = Nothing End Function -----Original Message----- From: John Colby [mailto:jwcolby at colbyconsulting.com] Sent: Wednesday, February 01, 2006 9:51 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Manipulating Excel Cells I'm baaaack. ;-) Here's the deal. I am working with a spreadsheet that has columns of systems and rows of documents. Therefore each cell represents a system-document. BTW, this was a "source" for me to build a pair of tables - tblSystem and tblDocument. I then added a field to tblDocument called SpreadsheetRow and a field to tblSystem called SpreadsheetColumn. We are tracking the receipt of these documents. The client now wants to see, back in his original spreadsheet, the "status" of a given system document using colors to express the status - white = not assigned, red = not received, yellow = partial receipt, green = received. So... I have to go "poke colors" out into the spreadsheet. I have discovered the "area" property which has a color attribute. What I need now is a translation from the column LETTERS to a column number since for some bizarre reason the columns have letter names but cells are referenced by column numbers. "Brain damaged children" as Bill Cosby would say. Does anyone have code for manipulating cells by cell(intRowNumbers, strColNames)? John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com *********************************************************************** The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please contact the sender and delete the material from any computer. As a recipient of this email, you are responsible for screening its contents and the contents of any attachments for the presence of viruses. No liability is accepted for any damages caused by any virus transmitted by this email.