Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default input string into a column based on the value of a cell

I ran into a problem.
I have an excel spreadsheet that has many records.
I need a macro to look up every instance of a value greater then 70% in row C.
Row C is a formula.
If it is greater then 70% then I need Row E to say "Over" in the same record.
I need this to happen after every occurance.

Can someone please help me, I am new to this forum.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default input string into a column based on the value of a cell

On Apr 11, 8:54 am, BZeyger wrote:
I ran into a problem.
I have an excel spreadsheet that has many records.
I need a macro to look up every instance of a value greater then 70% in row C.
Row C is a formula.
If it is greater then 70% then I need Row E to say "Over" in the same record.
I need this to happen after every occurance.

Can someone please help me, I am new to this forum.


You don't really need a macro to do this because you can write a
simple IF function and copy the formula down. For example, in cell E1
you can write =IF(C1.7,"Over","") and then copy the formula down.

I included one way to write a macro for this, but it does the same
thing as the IF function in Excel. The code is dependent on your data
set being contiguous.

Sub over70()

Dim a As Long
Dim counter As Long

counter = Range("c1").CurrentRegion.Rows.Count

For a = 1 To counter
If Range("c" & a).Value 0.7 Then
Range("e" & a).Value = "Over"
End If
Next

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default input string into a column based on the value of a cell

Sub MarkE()
Dim rng as Range, cell as Range
Columns(5).ClearContents
set rng = Range("C1",cells(rows.count,"C").End(xlup))
for each cell in rng
if application.IsNumber(cell) then
if instr(1,cell.text,"%",vbTextcompare) then
if cell.Value .70 then
cell.offset(0,2).value = "Over"
end if
end if
end if
Next
End Sub

Test this on a copy of your worksheet.

--
Regards,
Tom Ogilvy


"BZeyger" wrote:

I ran into a problem.
I have an excel spreadsheet that has many records.
I need a macro to look up every instance of a value greater then 70% in row C.
Row C is a formula.
If it is greater then 70% then I need Row E to say "Over" in the same record.
I need this to happen after every occurance.

Can someone please help me, I am new to this forum.

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
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
Summing a column based on input in a cell Taza Excel Discussion (Misc queries) 2 April 3rd 08 03:58 AM
run macro with input msg based on cell input Janelle S Excel Discussion (Misc queries) 0 January 20th 08 05:23 AM
How to avoid duplicate string value input in one column? Wavelet Excel Worksheet Functions 1 March 30th 07 05:04 AM
Open and Append based on input string wooljr Excel Programming 1 February 1st 07 01:45 AM


All times are GMT +1. The time now is 01:33 PM.

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

About Us

"It's about Microsoft Excel"