Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default HELP!!

I keep getting a compile error on the formula below and I can't figure out
what I have wrong... The error comes up 'duplicate declaration in current
scope' right under 'Creates Formula for LO Commission....Can you guys help me?

'Creates formula for Total Fee Income
Dim cell As Range
For Each cell In Range("L1:L100")
cell.Replace What:="0", Replacement:="=(E" & cell.Row & "+F" & cell.Row & _
"+G" & cell.Row & "+H" & cell.Row & ")-K" & cell.Row, LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False

'Creates Formula for LO Commission
Dim cell As Range
For Each cell In Range("N1:N100")
cell.Replace What:="0", Replacement:="=(L" & cell.Row & "*M" & cell.Row & _
")-J" & cell.Row, LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False

Next
Range("J5").Select

'Adds $ formatting
Columns("D:D").Select
ActiveWindow.SmallScroll ToRight:=3
Columns("D:L").Select
Selection.NumberFormat = _
"_([$$-409]* #,##0.00_);_([$$-409]* (#,##0.00);_([$$-409]*
""-""??_);_(@_)"
Columns("N").Select
Selection.NumberFormat = _
"_([$$-409]* #,##0.00_);_([$$-409]* (#,##0.00);_([$$-409]*
""-""??_);_(@_)"
Range("A1").Select
End Sub



--
Thanks a bunch!
rojobrown
 
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



All times are GMT +1. The time now is 11:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"