PC Review


Reply
Thread Tools Rate Thread

Compare values and place variable value on sh2

 
 
=?Utf-8?B?UmljayBTLg==?=
Guest
Posts: n/a
 
      16th Oct 2007
In the following code, I am not understanding how to pass the variable value
to my other sheet (Sh2).

===============
'====================
'Originating author: Joel from "microsoft.public.excel.programming" 10.09.07
'Modified 10.10.07
'====================
'compare sheet 1 with sheet 2
For Each sh1cell In sh1range
Set c = sh2range.Find( _
What:=sh1cell, LookIn:=xlValues, LookAt:=xlWhole)' Added "xlWhole"
If c Is Nothing Then
sh1cell.Offset(0, 2).Value = "No Match Found!"
sh1cell.Offset(0, 2).Font.Color = -16776961
sh1cell.Offset(0, 2).Font.Bold = True
Else
If sh1cell.Offset(0, 1) <> c.Offset(0, 1) Then
sh1cell.Offset(0, 2).Font.Italic = True
sh1cell.Offset(0, 2).ColumnWidth = 25
sh1cell.Offset(0, 2).Value = "Revision Level Change!"
sSh1RevIs = sh1cell.Offset(0, 1) ' Capture Revision level of Sh1 if
False
MsgBox sSh1RevIs 'for testing...Show Rev from Sh1
End If
End If
Next sh1cell
====================
The variable "sSh1RevIs" captures the value I want (revision level of
"sh1cell.Offset(0, 1)") but I cannot figure out how to place this value on
the same row (column D) on Sh2 (compared row of Sh1 and Sh2).

--
Regards

Rick
XP Pro
Office 2007

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      16th Oct 2007
sheets("Sheet2").Range("D" & sh1cell.row) = sSh1RevIs


"Rick S." wrote:

> In the following code, I am not understanding how to pass the variable value
> to my other sheet (Sh2).
>
> ===============
> '====================
> 'Originating author: Joel from "microsoft.public.excel.programming" 10.09.07
> 'Modified 10.10.07
> '====================
> 'compare sheet 1 with sheet 2
> For Each sh1cell In sh1range
> Set c = sh2range.Find( _
> What:=sh1cell, LookIn:=xlValues, LookAt:=xlWhole)' Added "xlWhole"
> If c Is Nothing Then
> sh1cell.Offset(0, 2).Value = "No Match Found!"
> sh1cell.Offset(0, 2).Font.Color = -16776961
> sh1cell.Offset(0, 2).Font.Bold = True
> Else
> If sh1cell.Offset(0, 1) <> c.Offset(0, 1) Then
> sh1cell.Offset(0, 2).Font.Italic = True
> sh1cell.Offset(0, 2).ColumnWidth = 25
> sh1cell.Offset(0, 2).Value = "Revision Level Change!"
> sSh1RevIs = sh1cell.Offset(0, 1) ' Capture Revision level of Sh1 if
> False
> MsgBox sSh1RevIs 'for testing...Show Rev from Sh1
> End If
> End If
> Next sh1cell
> ====================
> The variable "sSh1RevIs" captures the value I want (revision level of
> "sh1cell.Offset(0, 1)") but I cannot figure out how to place this value on
> the same row (column D) on Sh2 (compared row of Sh1 and Sh2).
>
> --
> Regards
>
> Rick
> XP Pro
> Office 2007
>

 
Reply With Quote
 
=?Utf-8?B?UmljayBTLg==?=
Guest
Posts: n/a
 
      17th Oct 2007
Once again, Thank You!

--
Regards

Rick
XP Pro
Office 2007



"Joel" wrote:

> sheets("Sheet2").Range("D" & sh1cell.row) = sSh1RevIs
>
>
> "Rick S." wrote:
>
> > In the following code, I am not understanding how to pass the variable value
> > to my other sheet (Sh2).
> >
> > ===============
> > '====================
> > 'Originating author: Joel from "microsoft.public.excel.programming" 10.09.07
> > 'Modified 10.10.07
> > '====================
> > 'compare sheet 1 with sheet 2
> > For Each sh1cell In sh1range
> > Set c = sh2range.Find( _
> > What:=sh1cell, LookIn:=xlValues, LookAt:=xlWhole)' Added "xlWhole"
> > If c Is Nothing Then
> > sh1cell.Offset(0, 2).Value = "No Match Found!"
> > sh1cell.Offset(0, 2).Font.Color = -16776961
> > sh1cell.Offset(0, 2).Font.Bold = True
> > Else
> > If sh1cell.Offset(0, 1) <> c.Offset(0, 1) Then
> > sh1cell.Offset(0, 2).Font.Italic = True
> > sh1cell.Offset(0, 2).ColumnWidth = 25
> > sh1cell.Offset(0, 2).Value = "Revision Level Change!"
> > sSh1RevIs = sh1cell.Offset(0, 1) ' Capture Revision level of Sh1 if
> > False
> > MsgBox sSh1RevIs 'for testing...Show Rev from Sh1
> > End If
> > End If
> > Next sh1cell
> > ====================
> > The variable "sSh1RevIs" captures the value I want (revision level of
> > "sh1cell.Offset(0, 1)") but I cannot figure out how to place this value on
> > the same row (column D) on Sh2 (compared row of Sh1 and Sh2).
> >
> > --
> > Regards
> >
> > Rick
> > XP Pro
> > Office 2007
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare values and place corresponding value in another sheet Whitney Microsoft Excel Misc 3 14th Apr 2009 04:45 PM
Copying values from place to place =?Utf-8?B?TWVyY2Fkb2dz?= Microsoft Access 3 23rd Oct 2007 12:13 PM
Excel Compare values in columns & display missing values in a new =?Utf-8?B?Y3BldHRh?= Microsoft Excel Misc 1 2nd Apr 2005 05:51 AM
Compare a Variable Against Multiple Values Jason Microsoft VB .NET 5 23rd Feb 2005 06:46 PM
How do i compare values from two sheet and copy & paste if values match? =?Utf-8?B?cm96Yg==?= Microsoft Excel Programming 0 5th Mar 2004 12:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:43 PM.