Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default insert formula

Hello,
I thought I posted this, but I did not see it on the website.

I need help with inserting a formula into a selected range. After I
insert this formula I want to copy this formula down to the other rows
of the spreadsheet with the text 'target renewal'. When I try to simply
insert the formula the first time, I get 'Type mismatch error'. I have
not tried to copy yet, cause I can't even insert the formula. I am
lost, can someone help me.

Thanks


For intx = 1 To lngrow
Cells(intx, 1).Select
If InStr(1, ActiveCell.Value, " Target Renewal") 0
Then
Range(Cells(intx, 6), Cells(intx, 20)).Select
Selection.Formula =
"=IF(AND(OR($D$2=30,$D$2=60),D15=""aprent"")," -
",IF(OR(E19=$B$2*(1-($D$2/30)),E19=$B$2*(1-(($D$2-30)/30)),E19=$B$2*(1-(($D$2-60)/30)),E19=$B$2*(1-(($D$2-90)/30)),E19=$B$2),$B$2,IF((F15+$D$2)<30,$B$2*(1-($D$2/30)),IF(OR(D15=""aprent"",F150),"
- ",IF((F15+E15+$D$2)<60,$B$2*(1-(($D$2-30)/30)),IF(D19=""," -
",IF((D15+E15+F15+$D$2)<90,$B$2*(1-(($D$2-60)/30))," - ")))))))"
Selection.Value = Selection.Value
End If
Next

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default insert formula

It appears at a glance that you still have work to do on your "doubled-up"
quote marks within the string value.

Selection.Formula = "=IF(AND(OR($D$2=30,$D$2=60),D15=""aprent"")," -

(it looks good up to ""aprent"", but need to double-up quote marks beyond
that, i.e. "" - "")


" wrote:

Hello,
I thought I posted this, but I did not see it on the website.

I need help with inserting a formula into a selected range. After I
insert this formula I want to copy this formula down to the other rows
of the spreadsheet with the text 'target renewal'. When I try to simply
insert the formula the first time, I get 'Type mismatch error'. I have
not tried to copy yet, cause I can't even insert the formula. I am
lost, can someone help me.

Thanks


For intx = 1 To lngrow
Cells(intx, 1).Select
If InStr(1, ActiveCell.Value, " Target Renewal") 0
Then
Range(Cells(intx, 6), Cells(intx, 20)).Select
Selection.Formula =
"=IF(AND(OR($D$2=30,$D$2=60),D15=""aprent"")," -
",IF(OR(E19=$B$2*(1-($D$2/30)),E19=$B$2*(1-(($D$2-30)/30)),E19=$B$2*(1-(($D$2-60)/30)),E19=$B$2*(1-(($D$2-90)/30)),E19=$B$2),$B$2,IF((F15+$D$2)<30,$B$2*(1-($D$2/30)),IF(OR(D15=""aprent"",F150),"
- ",IF((F15+E15+$D$2)<60,$B$2*(1-(($D$2-30)/30)),IF(D19=""," -
",IF((D15+E15+F15+$D$2)<90,$B$2*(1-(($D$2-60)/30))," - ")))))))"
Selection.Value = Selection.Value
End If
Next


Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert formula John Excel Discussion (Misc queries) 3 May 25th 10 04:25 PM
how to insert a formula? JoeF Excel Discussion (Misc queries) 4 November 29th 09 04:38 AM
insert formula [email protected] Excel Worksheet Functions 0 May 17th 06 12:45 PM
Insert a value into formula Ed Excel Discussion (Misc queries) 5 April 16th 06 06:25 AM
insert a new row by formula Doug Excel Worksheet Functions 3 November 18th 04 12:28 PM


All times are GMT +1. The time now is 09:06 AM.

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

About Us

"It's about Microsoft Excel"