Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am looking in column A of the sheets for a name and each name will have a value next to it in B. The name may appear multiple times per sheet, so find next or all is necessary for a total across all sheets. Assume In code below all is Dimmed correctly, how to add all the varOut's as they are found in column A .Offset(, 1) of each sheet in array. Can the same code lines be used for constants and values from formulas or is a PasteSpecial.Values needed? Once I have the correct code lines to add the varOut's I assume I can also use that code with FIND as the search method also? Not stuck on this code if it can be quicker or more efficient. Thanks. Howard MyArr = Array("Sheet2", "Sheet3", "Sheet4") For i = LBound(MyArr) To UBound(MyArr) With Sheets(MyArr(i)) lr = .Cells(.Rows.Count, 1).End(xlUp).Row Set rngA = .Range("A1:A" & lr) For Each c In rngA If c = myName Then varOut = c.Offset(, 1) '/ add all the varOut's '/ together as they are found '/ across all the sheets '/ and display total in msgbox End If Next 'c End With Next 'i MsgBox "The total for " & myName & " is: " & varOut |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MsgBox to display [hh]:mm | Excel Programming | |||
Making a msgbox return a value in one cell, when data is searched and found in another. TIA | Excel Programming | |||
Running total of Found Substrings in MainString in Big Loop | Excel Programming | |||
How to display remaining txt file which overflowed MsgBox display? | Excel Discussion (Misc queries) | |||
If no FIND value is found, then a Msgbox to say so and exit sub | Excel Programming |