Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() i created 2 variables string which are o1 and o2. i wanted to store a value at an offset to o1 and select another sheet and store a value at the offset of sheet2 in variable o2 but it doesn't work, it only stores the values from the sheet1 to the 2 variables count is an int variable Sheets(1).Select o = sheet.Offset(count, 0).Value Sheets(2).Select o2 = sheet.Offset(count, 2).Value the problem is itn't store what it suppose to be! someone help please! here is the whole macro Code: -------------------- Sub check() Dim count As Integer Dim sheet As Object Dim he As String Dim o As String Dim o2 As String Set sheet = ActiveCell If (sheet.Offset(1, 22) = 1) Then For count = 1 To 150 Sheets(1).Select o = sheet.Offset(count, 0).Value Sheets(2).Select o2 = sheet.Offset(count, 2).Value If (o < o2) Then he = MsgBox(o & " is not equal to " & o2 & " at (" & count & ", 0) and (" & count & ", 27)", vbOKCancel + vbInformation, "Error") Select Case he Case vbCancel Exit Sub End Select End If Next End If Sheets(1).Select MsgBox "No Error!", vbOKOnly + vbInformation, "Done!" End Sub -------------------- thanks -- bangity ------------------------------------------------------------------------ bangity's Profile: http://www.excelforum.com/member.php...o&userid=31078 View this thread: http://www.excelforum.com/showthread...hreadid=507525 |