Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
searching a cellvalue in a range
I am familiar with VBA in Access but not in XL.
I am looking for code (On Change event from a Spinbutton) which searches in a range of cells (called "Schoolyear") the value which stays in cell B10. If found the value of the cell should change to the value from B10 I started with the code from the Help file but I cannot adapt it. With Worksheets(1).Range("a1:a500") Set c = .Find(2, lookin:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do c.Value = 5 Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If end withShould I declare variables and objects? tks for helping Michel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
searching a cellvalue in a range
The code you found in HELP is good. It is looking in range("a1:a500"). So
change that. It is looking for the number 2. If found it is changing the found cell to 5. Adapt to suit. -- Don Guillett SalesAid Software "newsbin.telenet.be" wrote in message ... I am familiar with VBA in Access but not in XL. I am looking for code (On Change event from a Spinbutton) which searches in a range of cells (called "Schoolyear") the value which stays in cell B10. If found the value of the cell should change to the value from B10 I started with the code from the Help file but I cannot adapt it. With Worksheets(1).Range("a1:a500") Set c = .Find(2, lookin:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do c.Value = 5 Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If end withShould I declare variables and objects? tks for helping Michel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i update filter in a pivottable based on a cellvalue? | Excel Discussion (Misc queries) | |||
transpose horizantal basing on cellvalue | Excel Discussion (Misc queries) | |||
Different validation list based on cellvalue on the left | Excel Worksheet Functions | |||
Searching a range and copying values into a new range.... **Please help** :( | Excel Programming | |||
different cellcolor depending on cellvalue | Excel Programming |