Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help!


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

 
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



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