![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Charleston,sc
Posts: 9
|
OK I would like to do something but I'm not sure if it is possible. And if I should look at another way of doing it. Its seems simple, and it may be, but I just can't seem to get it. First here is the code:
For i = 1 To 13 Cells(i + 9, 4).Select Selection.NumberFormat = "0.0" With Selection .HorizontalAlignment = xlCenter End With ActiveCell.formula = _ "=sumif('Gene''s Hours'!S6:S499,""=2"" ,'Gene''s Hours'!T6:T499)" Next i End Sub The problem is I want the "=2" in the code to be =i the variable. The reason I'm doing this is the chart the info is coming from is being updated frequently by another macro and is causing an error to occur when the formula is just typed into the cell. So, I am trying to use this macro to reinsert to formulas when the info is updated. Thanks All, EMS |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
EMS,
Something like this shoud work:
|
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Location: Charleston,sc
Posts: 9
|
Thanks Mark, it worked perfectly. I was trying something like that but didn't think about chr().
Sincere thanks, EMS |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|