![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 21
|
How do I create code so that it
1. Checks data in Column A that starts with a "Y" (ie YYZ, YVR, YMX, YYC...airport codes) 2. Types in a formula that uses a formula (let's say =i + b) into column C 3. and once no more criteria matches step one, it finishs? I've tried to make it simple--if it's too simple let me know.... thanks guys! [ This Message was edited by: XLerator on 2002-05-23 22:30 ] |
|
|
|
|
|
#2 | |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,030
|
Hey,
Do you need this done in VBA or can you live with a formula? Since I don't know the code off the top of my head: Quote:
Hope that helps you out somewhat, Adam |
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 21
|
Hi Adam,
This is perfect! Thank you so much. Dylan |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Hi XLerator,
How many rows has a data in columnA? Here is an easy sample, but slow.
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Apr 2002
Posts: 21
|
Each day, the number of rows with data is different, some days it may be 150, others 153, 165, 200 etc....
|
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Is this what your looking for ?
Code:
Public Sub AddFormula()
With ActiveSheet
For rw = 1 To .Cells(65536, 1).End(xlUp).Row
If UCase(Left(Trim(.Cells(rw, 1).Value), 1)) = "Y" Then _
.Cells(rw, 3).Formula = "=i + b"
Next 'rw
End With
End Sub
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|