Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Goto location of another cell value

Hi All.....

If someone please, I am in need of code to select the cell in column B of
Sheet2, that contains a value matching that of cell B4 in Sheet1......and
then color the background of that cell RED. There will only be one cell in
Sheet2!B:B that will contain a matching value.

TIA
Vaya con Dios,
Chuck, CABGx3



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Goto location of another cell value

Sub FindStuff()
dim rngToFind as range
dim rngToSearch as range
dim rngFound as Range

set rngToFind = Sheets("Sheet1").Range("B4")
set rngToSeach = Sheets("Sheet2").Columns("B")
set rngFound = rngToSeach.Find(What:=rngTofind.Value, _
LookAt:=xlWhole, _
Lookin:=xlFormulas, _
MatchCase:=False)
if rngFound is nothing then
msgbox "Sorry... Not Found"
else
rngFound.Inerior.ColorIndex = 3
end if
end sub

--
HTH...

Jim Thomlinson


"CLR" wrote:

Hi All.....

If someone please, I am in need of code to select the cell in column B of
Sheet2, that contains a value matching that of cell B4 in Sheet1......and
then color the background of that cell RED. There will only be one cell in
Sheet2!B:B that will contain a matching value.

TIA
Vaya con Dios,
Chuck, CABGx3



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Goto location of another cell value

Oops. Typo...
rngFound.Inerior.ColorIndex = 3
should be
rngFound.Interior.ColorIndex = 3

--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Sub FindStuff()
dim rngToFind as range
dim rngToSearch as range
dim rngFound as Range

set rngToFind = Sheets("Sheet1").Range("B4")
set rngToSeach = Sheets("Sheet2").Columns("B")
set rngFound = rngToSeach.Find(What:=rngTofind.Value, _
LookAt:=xlWhole, _
Lookin:=xlFormulas, _
MatchCase:=False)
if rngFound is nothing then
msgbox "Sorry... Not Found"
else
rngFound.Inerior.ColorIndex = 3
end if
end sub

--
HTH...

Jim Thomlinson


"CLR" wrote:

Hi All.....

If someone please, I am in need of code to select the cell in column B of
Sheet2, that contains a value matching that of cell B4 in Sheet1......and
then color the background of that cell RED. There will only be one cell in
Sheet2!B:B that will contain a matching value.

TIA
Vaya con Dios,
Chuck, CABGx3



  #4   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Goto location of another cell value

LOL.........no problem Jim, I found that one too........many "Thank you's",
it works perfectly for me...........BTW, if I could impose a little more
please.......could this be modified to also color the 3 cells to the right
of the rngFound?

Thanks again,
Vaya con Dios,
Chuck, CABGx3




"Jim Thomlinson" wrote:

Oops. Typo...
rngFound.Inerior.ColorIndex = 3
should be
rngFound.Interior.ColorIndex = 3

--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Sub FindStuff()
dim rngToFind as range
dim rngToSearch as range
dim rngFound as Range

set rngToFind = Sheets("Sheet1").Range("B4")
set rngToSeach = Sheets("Sheet2").Columns("B")
set rngFound = rngToSeach.Find(What:=rngTofind.Value, _
LookAt:=xlWhole, _
Lookin:=xlFormulas, _
MatchCase:=False)
if rngFound is nothing then
msgbox "Sorry... Not Found"
else
rngFound.Inerior.ColorIndex = 3
end if
end sub

--
HTH...

Jim Thomlinson


"CLR" wrote:

Hi All.....

If someone please, I am in need of code to select the cell in column B of
Sheet2, that contains a value matching that of cell B4 in Sheet1......and
then color the background of that cell RED. There will only be one cell in
Sheet2!B:B that will contain a matching value.

TIA
Vaya con Dios,
Chuck, CABGx3



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Goto location of another cell value

Sub FindStuff()
dim rngToFind as range
dim rngToSearch as range
dim rngFound as Range

set rngToFind = Sheets("Sheet1").Range("B4")
set rngToSeach = Sheets("Sheet2").Columns("B")
set rngFound = rngToSeach.Find(What:=rngTofind.Value, _
LookAt:=xlWhole, _
Lookin:=xlFormulas, _
MatchCase:=False)
if rngFound is nothing then
msgbox "Sorry... Not Found"
else
rngFound.Resize(,3).Interior.ColorIndex = 3
end if
end sub

--
HTH...

Jim Thomlinson


"CLR" wrote:

LOL.........no problem Jim, I found that one too........many "Thank you's",
it works perfectly for me...........BTW, if I could impose a little more
please.......could this be modified to also color the 3 cells to the right
of the rngFound?

Thanks again,
Vaya con Dios,
Chuck, CABGx3




"Jim Thomlinson" wrote:

Oops. Typo...
rngFound.Inerior.ColorIndex = 3
should be
rngFound.Interior.ColorIndex = 3

--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Sub FindStuff()
dim rngToFind as range
dim rngToSearch as range
dim rngFound as Range

set rngToFind = Sheets("Sheet1").Range("B4")
set rngToSeach = Sheets("Sheet2").Columns("B")
set rngFound = rngToSeach.Find(What:=rngTofind.Value, _
LookAt:=xlWhole, _
Lookin:=xlFormulas, _
MatchCase:=False)
if rngFound is nothing then
msgbox "Sorry... Not Found"
else
rngFound.Inerior.ColorIndex = 3
end if
end sub

--
HTH...

Jim Thomlinson


"CLR" wrote:

Hi All.....

If someone please, I am in need of code to select the cell in column B of
Sheet2, that contains a value matching that of cell B4 in Sheet1......and
then color the background of that cell RED. There will only be one cell in
Sheet2!B:B that will contain a matching value.

TIA
Vaya con Dios,
Chuck, CABGx3





  #6   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Goto location of another cell value

So cool that is..................."it's easy when you know how", <g

Thanks Jim, you da man!

Vaya con Dios,
Chuck, CABGx3




"Jim Thomlinson" wrote:

Sub FindStuff()
dim rngToFind as range
dim rngToSearch as range
dim rngFound as Range

set rngToFind = Sheets("Sheet1").Range("B4")
set rngToSeach = Sheets("Sheet2").Columns("B")
set rngFound = rngToSeach.Find(What:=rngTofind.Value, _
LookAt:=xlWhole, _
Lookin:=xlFormulas, _
MatchCase:=False)
if rngFound is nothing then
msgbox "Sorry... Not Found"
else
rngFound.Resize(,3).Interior.ColorIndex = 3
end if
end sub

--
HTH...

Jim Thomlinson


"CLR" wrote:

LOL.........no problem Jim, I found that one too........many "Thank you's",
it works perfectly for me...........BTW, if I could impose a little more
please.......could this be modified to also color the 3 cells to the right
of the rngFound?

Thanks again,
Vaya con Dios,
Chuck, CABGx3




"Jim Thomlinson" wrote:

Oops. Typo...
rngFound.Inerior.ColorIndex = 3
should be
rngFound.Interior.ColorIndex = 3

--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Sub FindStuff()
dim rngToFind as range
dim rngToSearch as range
dim rngFound as Range

set rngToFind = Sheets("Sheet1").Range("B4")
set rngToSeach = Sheets("Sheet2").Columns("B")
set rngFound = rngToSeach.Find(What:=rngTofind.Value, _
LookAt:=xlWhole, _
Lookin:=xlFormulas, _
MatchCase:=False)
if rngFound is nothing then
msgbox "Sorry... Not Found"
else
rngFound.Inerior.ColorIndex = 3
end if
end sub

--
HTH...

Jim Thomlinson


"CLR" wrote:

Hi All.....

If someone please, I am in need of code to select the cell in column B of
Sheet2, that contains a value matching that of cell B4 in Sheet1......and
then color the background of that cell RED. There will only be one cell in
Sheet2!B:B that will contain a matching value.

TIA
Vaya con Dios,
Chuck, CABGx3



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
Goto a specific Cell Sanjay[_2_] Excel Programming 2 May 3rd 07 02:23 PM
How to goto the next available cell in a column. [email protected] Excel Programming 1 October 26th 06 05:15 PM
Goto a referenced cell mburkett Excel Programming 1 May 17th 06 09:35 PM
Goto Next VISIBLE cell below Rasmus[_2_] Excel Programming 5 May 24th 04 04:26 AM
goto a particular cell Newbie Excel Programming 5 April 15th 04 01:46 PM


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