Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Compare values and place variable value on sh2

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Compare values and place variable value on sh2

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Compare values and place variable value on sh2

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
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
Compare values and place corresponding value in another sheet Whitney Excel Discussion (Misc queries) 3 April 14th 09 04:45 PM
Place a variable inside a directory path Brad J.[_5_] Excel Programming 0 June 24th 06 04:38 PM
How do I use a variable in the place of a sheet name FCLinux Excel Programming 2 April 4th 06 07:24 PM
How do I create a macro that will compare columns and place data CompuCat Excel Worksheet Functions 0 March 20th 06 06:21 PM
how to place a variable cell into a range? ozoned Excel Programming 2 August 12th 03 07:58 AM


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