Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


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 do i update filter in a pivottable based on a cellvalue? Michael Murphy Excel Discussion (Misc queries) 0 February 8th 10 03:05 PM
transpose horizantal basing on cellvalue balu Excel Discussion (Misc queries) 1 February 10th 08 11:43 PM
Different validation list based on cellvalue on the left BKO Excel Worksheet Functions 2 June 8th 07 03:24 PM
Searching a range and copying values into a new range.... **Please help** :( Lancia Excel Programming 1 September 29th 04 01:08 PM
different cellcolor depending on cellvalue dsg Excel Programming 3 April 29th 04 03:23 PM


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