Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how do I reference two types of multiple sheet in a code. I have sheets with
name _Balance adding up ranges and I want to reference another sheet named _Trial to add different range together. Code sample Dim ws As Worksheet Application.ScreenUpdating = False For Each ws In Worksheets 'this calculate on only sheets named _Balances If InStr(1, ws.Name, "_Balances") Then With ws ..Range("g35").Value = .Range("g90").Value With .Range("g123") formStr = .Formula ..Formula = formStr & "+" & ws.Range("g76").Value End With I want to do a different calculation for some other sheet with named _Trial. So for sheet named _Trial I want to add range g39 to g20. I used an Elseif InStr(1, ws.Name, "_Trial") after If InStr(1, ws.Name, "_Balances") but I get error. Please help me figure this out. THanks for Helping.... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheet won't reference a named cell | Excel Worksheet Functions | |||
Formatting different zip code types within a column | Excel Discussion (Misc queries) | |||
vb code for renaming a work sheet with a cell reference | Excel Discussion (Misc queries) | |||
See code enclosed - Convert to formulas with absolute reference inculding the sheet references! | Excel Programming | |||
Reference Addin Module from sheet code | Excel Programming |