The W
Views: 98499946
Main | FAQ | Search: Y! / G | Color chart | Log in for more!
28.8.07 1817
The 7 - Internet & Computers - Excel & Visual Basic Question. Register and log in to post!
(336 newer) Next thread | Previous thread
User
Post (2 total)
Jobberman
Kishke
Level: 44

Posts: 302/426
EXP: 597727
For next: 13562

Since: 2.1.02
From: West Palm Beach, FL

Since last post: 26 days
Last activity: 24 days
#1 Posted on 4.5.05 1334.22
Reposted on: 4.5.12 1334.22
From reading this forum for a few years, I know there are some very intelligent people around here. Hopefully one can help a bit.

I am trying to put a little piece of code in a visual basic program that will check a specific cell in an MS Excel spreadsheet. If the cell is empty, it will generate a random number and insert it. If the cell already has a value in it, no change would be made. I know very, VERY little as far as programming goes, so searches for this always led me to places way over my head.

Any help would be appreciated,

Thanks.
Promote this thread!
whatever
Lap cheong
Level: 81

Posts: 619/1737
EXP: 4899432
For next: 93438

Since: 12.2.02
From: Cleveland, Ohio

Since last post: 11 days
Last activity: 2 hours
#2 Posted on 4.5.05 1351.31
Reposted on: 4.5.12 1351.51
This is a sample I used in some VBA code embedded in an Excel spreadsheet.

This line checked if the cell value was blank. You could use the line in an "If-then" setup to set the .value parameter to the random number.

Sheet#.Cells(X, Y).Value = ""

where
# = the sheet number in Excel,
X = row number on the sheet
Y = column number on the sheet

Hope this helps!
ALL ORIGINAL POSTS IN THIS THREAD ARE NOW AVAILABLE
Thread ahead: Hotmail trouble, or just me?
Next thread: AOL IM Invisibility
Previous thread: Ticketmaster tips
(336 newer) Next thread | Previous thread
The 7 - Internet & Computers - Excel & Visual Basic Question.Register and log in to post!

The W™ message board - 7 year recycle

ZimBoard
©2001-2014 Brothers Zim
This old hunk of junk rendered your page in 0.178 seconds.