473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

controlling cells via variable

I do not believe this is a difficult question but I am having trouble figuring out the solution..

I have a dbgrid with a variable amount of rows and 4 columns
I want to take the cell value and copy the value into a spreadsheet using the excel control in vb. I am having difficulties calling the cell via variable

Ex.

Dim X As Integer
Dim XX As Integer
xx = data1.recordset.absoluteposition
for x = 0 to xx
data1.recordset.absoluteposition = x
y = x + 1
Spreadsheet1.Cells(Y, 1) = Data1.Recordset("Table column1 value")
Spreadsheet1.Cells(Y, 1) = Data1.Recordset("Table column2 value")
Spreadsheet1.Cells(Y, 1) = Data1.Recordset("Table column3 value")
Spreadsheet1.Cells(Y, 1) = Data1.Recordset("Table column4 value")
next x ....


I am receiving an error when trying to reference the Y value when calling the cell


Thanks
Nov 23 '09 #1
1 1051
problem solved sorry... i needed to add the y value as a variant
Nov 23 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: J. VerSchave | last post by:
I am curious if there is a way to handle this... maybe with Javascript... Is there a way to set a TEXTAREA field so that the tab key on the user's keyboard will create a tab within the text...
4
by: BerkshireGuy | last post by:
I have the following Access code that exports to Excel, inserts a title, changes the color of the title, and then changes the format of several columns to currency. The following code sometimes...
0
by: Ramesh Chawla | last post by:
Hi, I am making a table in ASP.NET at the runtime and loading the data in the left and the right most colums and in between there are 9 columns on which data from either of the columns(left...
1
by: JoNa SuperGold | last post by:
hey, i have put a button in the header template of my datagrid, now this button has te purpose that when you check the checkboxes in the item template and you click on the button, the selected data...
0
by: Al Christians | last post by:
I'm starting to test a python application that creates an Excel workbook, then fills in values for some cells and formulas for other cells. The formulas involve circular references, which will...
1
by: aspnoob | last post by:
hello i just started off with asp.net , needed some help on how to display the state of checkboxes from a SQL database. my database table has the following format seat.dbo ( db design) (...
1
by: Chris | last post by:
I'm sitting with a bit of an issue with pyExcelerator and creating an Excel file with certain cells protected while the rest of the spreadsheet is password protected. The Protection class under...
2
by: Rudi Hausmann | last post by:
Hi! I want to create a table with following fixed width, no matter what content is inside of the table cells: 100 40 40 (first row with 1 + 2 cells) 100 10 10 10 10 10 10...
0
by: DonnaDarko | last post by:
Hi again, I have a question regarding how to control one form's values from another form. I have figured out that the best spot for this control comes from the OKButton on a form called...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.