Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can VB variables be used in a cell formula? For example I have columns of
data on one sheet and a list to compare to on another. I can put a formula in a cell and copy down the comparison list to get what I want. This comparison list remains constant and part of the workbook. I can write this formula to a range of cells next to the comparison list from VB: Range("A2:A90").FormulaArray = "=SUM((Dan!$E$1:$E$504="""")*(Dan!$B$1:$B$504=A2)) " In this case a database named Dan.dbf was queried and brought in on a new sheet which I named "Dan". Dan has 504 rows of data. This query routine needs to work on any file queried, so I have assigned variables to the sheet name and the rowcount nwsht = "Dan" rowcount = 504 How can I substitute these 2 variables into the above formula? I have played with syntax variations of all I can think of. Any advice will be greatly appreciated. Thanks, Mike |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Two formulas in on cell based on two numbers in another cell? | Excel Discussion (Misc queries) | |||
Carrying formulas over to new cell when old cell is deleted: possi | Excel Worksheet Functions | |||
How to trace a cell? Which cells use a special cell in formulas? | Excel Discussion (Misc queries) | |||
Copying formulas from cell to cell to cell to....... | Excel Discussion (Misc queries) | |||
change cell value greater than another cell value using formulas | Excel Worksheet Functions |