Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Comparing cell to array

For some reason i have put a name of a sheet in an array and i am
trying to compare the array to a cell value that has the same name.
It will come back with and error that indicates that no cells mach any
name in the array. When i debug. print and use the immediate box to
see what values are in both places they are the same. Help


Sub sheetray()
Dim b As Long
b = 2
Do While Cells(1, b).Value < ""
If Len(Cells(1, b).Value) 9 Then
b = b + 1
Else
Cells(1, b).Value = Cells(1, b).Value + ".accum"
b = b + 1
End If
Loop

Dim SNarray, i
Dim table(1 To 100, 1 To 3) As Variant
Dim j As Long
Dim z As Long
ReDim SNarray(1 To Sheets.Count)
Dim name As String
Dim arch As String

For i = 1 To Sheets.Count
SNarray(i) = ThisWorkbook.Sheets(i).name
Debug.Print SNarray(i)
Next
Dim x As Long

For j = 2 To Sheets.Count
Sheets(SNarray(j)).Select
table(j, 1) = Cells(2, 7).Value
table(j, 2) = Cells(2, 9).Value
Sheets("Sheet1").Select
x = 2

Do While SNarray(j) < Cells(1, x).Value
x = x + 1
Loop
Cells(2, x).Value = table(j, 1)
Cells(3, x).Value = table(j, 2)
Debug.Print table(j, 1)
Debug.Print table(j, 2)
Next j

Sheets(SNarray(2)).Select
end sub

The cells b2 - b50 are formated to be CAE130001+ incrementing to 50.
The sheets are named Sheet1 and CAE130017.accum, CAE130022.accum and a
couple more in the column with a sheet name that is equal to the name
in the cell the probram retreves a value from the sheet with the
corisponding value and puts in into sheet one in a designated
location. This only gets values at SHeet name = Cells name . Please
help

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
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
Comparing columns of text: cell value into array Myo_77 Excel Discussion (Misc queries) 0 December 5th 07 11:56 AM
Comparing An Array in VBA Greg Excel Discussion (Misc queries) 3 January 19th 06 06:31 PM
return array result in cell based on comparing dates Ruthki Excel Worksheet Functions 7 June 30th 05 11:41 PM
Comparing a value to an array Michael J. Malinsky Excel Programming 3 September 15th 03 08:54 PM


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