Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old August 19th, 2003, 09:58 AM
Chris X1 Chris X1 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 1 Chris X1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Excel workseet in vb

I am a beginner to programming, but i generally know the basics and i can program most things. However i do not know how to use a worksheet in visual basic. I do not want to have to use the excel application.
I just want to know how to reference a cell. I am using Vb6 and everything i have seen does not work, i have tried:

Worksheet.("sheet1").range(1,1)
sheet1.cells(1,1)
cells(1,1)

These are the 3 i have seen from searching the web, and nothing seems to work, if someone can just tell me, for example, how to put 1 into any cell i should be able to work the rest out myself

Thanks
Chris

Reply With Quote
  #2  
Old August 19th, 2003, 11:17 PM
Jeff B Jeff B is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 3 Jeff B User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Excell refers to cells two ways.

"Range" uses the A1 approach where "A" is the column and "1" is the row. So

Range("B2") .value = 1

would put the number one in cell B2.

The other way is by using Cells. Which refers to both the row and column by number.

Cells (6,4).value = 1

would put the number one in row 6 column 4

Reply With Quote
  #3  
Old August 20th, 2003, 11:25 AM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,169 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 8 h 34 m 4 sec
Reputation Power: 110
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
depending on what you are trying to do, I usually just reference the entire excel method structure. For example, xlapp.cells(1,1) = cstr("Whatchagonnado"), or xlapp.range("A1","B1"). I have written a short function that takes a known value, such as adors.recordcount, and determines the appropriate hex-based cell number for each item... what are you trying to do in excel?
__________________
Fisherman

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Excel workseet in vb


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway