Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Pick value off sheet list for VBA code determination

Apologies for the cross post.

Here is a sample of VBA code used to place a value in a cell base on
the value entered in the cell previous

If LCase(.Value) = "capital" OR _
LCase(.Value) = "grounds" OR _

(etc., for many lines)

..Offset(0, 1).Value = "MP"

The code works fine. Now I want to refer to a list on a sheet to
determine the value of a cell, i.e., if the value in a cell equals an
item from the sheet list, then a value is assigned to another cell.

Is this possible?

Thank you in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Pick value off sheet list for VBA code determination

hi
i did a little test and it works
Sub Test()
Dim c As Range
Dim r As Range
Set r = ActiveCell
For Each c In Range("J1:J5") ' your list?
If c.Value = r.Value Then
ActiveCell.Offset(0, 1).Value = "gotit"
Exit For
End If
Next
End Sub

it should give you the basic idea. edit to fit your code.
"Bill (Unique as my name)" wrote:

Apologies for the cross post.

Here is a sample of VBA code used to place a value in a cell base on
the value entered in the cell previous

If LCase(.Value) = "capital" OR _
LCase(.Value) = "grounds" OR _

(etc., for many lines)

..Offset(0, 1).Value = "MP"

The code works fine. Now I want to refer to a list on a sheet to
determine the value of a cell, i.e., if the value in a cell equals an
item from the sheet list, then a value is assigned to another cell.

Is this possible?

Thank you in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Pick value off sheet list for VBA code determination

On Sep 21, 12:02 pm, FSt1 wrote:
hi
i did a little test and it works
Sub Test()
Dim c As Range
Dim r As Range
Set r = ActiveCell
For Each c In Range("J1:J5") ' your list?
If c.Value = r.Value Then
ActiveCell.Offset(0, 1).Value = "gotit"
Exit For
End If
Next
End Sub

it should give you the basic idea. edit to fit your code.
"Bill (Unique as my name)" wrote:

Apologies for the cross post.


Here is a sample of VBA code used to place a value in a cell base on
the value entered in the cell previous


If LCase(.Value) = "capital" OR _
LCase(.Value) = "grounds" OR _


(etc., for many lines)


..Offset(0, 1).Value = "MP"


The code works fine. Now I want to refer to a list on a sheet to
determine the value of a cell, i.e., if the value in a cell equals an
item from the sheet list, then a value is assigned to another cell.


Is this possible?


Thank you in advance.


Thanks FSt1. So beautiful. So Concise.

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
Pick value off sheet list for VBA code determination Bill (Unique as my name) Excel Discussion (Misc queries) 1 September 21st 07 06:52 PM
Look up list of values based on single value from pick list Donal P Excel Discussion (Misc queries) 3 August 13th 07 08:43 PM
time sheet determination of what day and time rate Oldjay Excel Worksheet Functions 1 September 12th 06 10:13 AM
Making pick list conditional on selection from previous pick list Stewart Excel Discussion (Misc queries) 1 June 27th 05 11:30 AM
Pick list on a sheet - multiple rows? quartz[_2_] Excel Programming 2 March 23rd 05 11:55 PM


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