Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help Retrieving Cell Values

I need some help with the code I am trying to write.

I am trying to loop down the rows, each time checking to see if the
first column is empty. If it is then I want to add a formula to
another cell, and loop again.

I'm not new to programming, but am new to VB (although I have done some
tutorials), and am having some problems figuring out how to select the
cell and then check to see if the value is empty.

This is the code that I have so far, as maybe it will help if you are
having trouble understanding what I am trying to accomplish.


Dim I As Integer
I = 0
Do While "" = Worksheets("Sheet1").Range(Cells(I, 1)).Formula
ActiveCell.FormulaR1C1 = WS10_Formula
ActiveCell.Offset(1, 0).Range("A1").Select
I = I + 1
Loop


Thanks!



PS If you know of any decent free tutorials that you could link me to
that would be great :)



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Help Retrieving Cell Values

Marshall,

This worked in Excel 97

It defines the blank cells in column A and puts a formula in column 2 (B)
Change the destination column and formula to match your needs.

Dim rng As Range, cel As Range
'
Set rng = Columns("A:A").SpecialCells(xlCellTypeBlanks)
For Each cel In rng
cel.Offset(0, 2).Formula = "=a1+b2"
Next

--
sb
"Marshall" wrote in message
...
I need some help with the code I am trying to write.

I am trying to loop down the rows, each time checking to see if the
first column is empty. If it is then I want to add a formula to
another cell, and loop again.

I'm not new to programming, but am new to VB (although I have done some
tutorials), and am having some problems figuring out how to select the
cell and then check to see if the value is empty.

This is the code that I have so far, as maybe it will help if you are
having trouble understanding what I am trying to accomplish.


Dim I As Integer
I = 0
Do While "" = Worksheets("Sheet1").Range(Cells(I, 1)).Formula
ActiveCell.FormulaR1C1 = WS10_Formula
ActiveCell.Offset(1, 0).Range("A1").Select
I = I + 1
Loop


Thanks!



PS If you know of any decent free tutorials that you could link me to
that would be great :)



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving values from another sheet circuit_breaker Excel Worksheet Functions 1 September 14th 09 06:12 PM
Retrieving Values from Cell with Macro Anift Setting up and Configuration of Excel 4 November 21st 06 05:22 AM
Help with Comparing values and retrieving values in Excel!!!!!! [email protected] Excel Worksheet Functions 1 November 17th 06 12:21 AM
Retrieving values from a specified sheet of a different file. Anift Excel Worksheet Functions 2 April 3rd 06 02:38 PM
retrieving values from a specified sheet Anift Excel Worksheet Functions 4 April 1st 06 01:14 PM


All times are GMT +1. The time now is 03:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"