Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default stupid me - search across row

Hi Folks,

I'm feeling mighty sumb this morning cause I just can't figure out how to
loop across a row on one sheet from column AJ to column AS searching for non
zero values, then performing a vlookup to return a descrition which is
associated with that value, then starting the process on the next row until I
reach the last row of data.

Can someone help jump start my brain?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default stupid me - search across row


For i = 1 To Cells(Rows.Count,"AJ").End(xlUp).Row
For Each cell In Range("AJ" & i & ":AS" & i)
if cell.Value < 0 Then
MsgBox Application.Vlookup(cell.Value,
Range("lookup_table"),2,False)
End If
Next cell
Next i

as a starter

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Stephen" wrote in message
...
Hi Folks,

I'm feeling mighty sumb this morning cause I just can't figure out how to
loop across a row on one sheet from column AJ to column AS searching for
non
zero values, then performing a vlookup to return a descrition which is
associated with that value, then starting the process on the next row
until I
reach the last row of data.

Can someone help jump start my brain?

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default stupid me - search across row

Looks good with modifications for testing purposes, but ow can I get the
cell.value to return as AJ2, AJ3, AJ4, AH2, AH3 AH4, etc. in the loop. Right
now I have it returning the actual value of the cell which fails the lookup...


For j = 1 To Cells(Rows.Count, "AJ").End(xlUp).Row
For Each cell In Range("AJ" & j & ":AS" & j)
If cell.Value 0 Then
Range("F" & NLastWearerRow + 2).Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(""" & cell &
""",Garments,2,FALSE)"
Range("G" & NLastWearerRow + 2).Select
ActiveCell.FormulaR1C1 = "=R[-13]C[7]"
Range("H" & NLastWearerRow + 2).Select
ActiveCell.FormulaR1C1 = "=R[-13]C[8]"
End If
Next cell
Next j


"Bob Phillips" wrote:


For i = 1 To Cells(Rows.Count,"AJ").End(xlUp).Row
For Each cell In Range("AJ" & i & ":AS" & i)
if cell.Value < 0 Then
MsgBox Application.Vlookup(cell.Value,
Range("lookup_table"),2,False)
End If
Next cell
Next i

as a starter

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Stephen" wrote in message
...
Hi Folks,

I'm feeling mighty sumb this morning cause I just can't figure out how to
loop across a row on one sheet from column AJ to column AS searching for
non
zero values, then performing a vlookup to return a descrition which is
associated with that value, then starting the process on the next row
until I
reach the last row of data.

Can someone help jump start my brain?

Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default stupid me - search across row

Try cell.address

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Stephen" wrote in message
...
Looks good with modifications for testing purposes, but ow can I get the
cell.value to return as AJ2, AJ3, AJ4, AH2, AH3 AH4, etc. in the loop.
Right
now I have it returning the actual value of the cell which fails the
lookup...


For j = 1 To Cells(Rows.Count, "AJ").End(xlUp).Row
For Each cell In Range("AJ" & j & ":AS" & j)
If cell.Value 0 Then
Range("F" & NLastWearerRow + 2).Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(""" & cell &
""",Garments,2,FALSE)"
Range("G" & NLastWearerRow + 2).Select
ActiveCell.FormulaR1C1 = "=R[-13]C[7]"
Range("H" & NLastWearerRow + 2).Select
ActiveCell.FormulaR1C1 = "=R[-13]C[8]"
End If
Next cell
Next j


"Bob Phillips" wrote:


For i = 1 To Cells(Rows.Count,"AJ").End(xlUp).Row
For Each cell In Range("AJ" & i & ":AS" & i)
if cell.Value < 0 Then
MsgBox Application.Vlookup(cell.Value,
Range("lookup_table"),2,False)
End If
Next cell
Next i

as a starter

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Stephen" wrote in message
...
Hi Folks,

I'm feeling mighty sumb this morning cause I just can't figure out how
to
loop across a row on one sheet from column AJ to column AS searching
for
non
zero values, then performing a vlookup to return a descrition which is
associated with that value, then starting the process on the next row
until I
reach the last row of data.

Can someone help jump start my brain?

Thanks!






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default stupid me - search across row

that's the one! thanks!

"Bob Phillips" wrote:

Try cell.address

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Stephen" wrote in message
...
Looks good with modifications for testing purposes, but ow can I get the
cell.value to return as AJ2, AJ3, AJ4, AH2, AH3 AH4, etc. in the loop.
Right
now I have it returning the actual value of the cell which fails the
lookup...


For j = 1 To Cells(Rows.Count, "AJ").End(xlUp).Row
For Each cell In Range("AJ" & j & ":AS" & j)
If cell.Value 0 Then
Range("F" & NLastWearerRow + 2).Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(""" & cell &
""",Garments,2,FALSE)"
Range("G" & NLastWearerRow + 2).Select
ActiveCell.FormulaR1C1 = "=R[-13]C[7]"
Range("H" & NLastWearerRow + 2).Select
ActiveCell.FormulaR1C1 = "=R[-13]C[8]"
End If
Next cell
Next j


"Bob Phillips" wrote:


For i = 1 To Cells(Rows.Count,"AJ").End(xlUp).Row
For Each cell In Range("AJ" & i & ":AS" & i)
if cell.Value < 0 Then
MsgBox Application.Vlookup(cell.Value,
Range("lookup_table"),2,False)
End If
Next cell
Next i

as a starter

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Stephen" wrote in message
...
Hi Folks,

I'm feeling mighty sumb this morning cause I just can't figure out how
to
loop across a row on one sheet from column AJ to column AS searching
for
non
zero values, then performing a vlookup to return a descrition which is
associated with that value, then starting the process on the next row
until I
reach the last row of data.

Can someone help jump start my brain?

Thanks!






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
Help Me I'm Stupid!!! ryevick[_2_] Excel Programming 18 November 21st 05 08:58 PM
Help Me I'm Stupid!!! ryevick Excel Programming 2 November 18th 05 06:15 PM
Stupid, stupid question.... DS Excel Programming 3 September 25th 05 03:51 PM
Stupid Karine Excel Worksheet Functions 0 May 29th 05 09:56 AM
Stupid Karine Charts and Charting in Excel 0 May 29th 05 09:56 AM


All times are GMT +1. The time now is 11:02 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"