Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Assigning Formula to a Range

I have a formula in Cell D5 on SheetName Formulas as follows:

=IF(MID(E5,LEN(E5)-1,1)="A","Kel Tech",IF(MID(E5,LEN(E5)-1,1)="B","South
Star",IF(MID(E5,LEN(E5)-1,1)="C","White
Rodgers",IF(MID(E5,LEN(E5)-1,1)="D","GRI",IF(MID(E5,LEN(E5)-1,1)="E","Graybar",IF(MID(E5,LEN(E5)-1,1)="F","Guest
Room",""))))))

It currently on the Formulas WS shows up as #Value! - but it is exactly
what I need to paste into my Cell D5 on SheetName Revised-CashOut
and actually I need to Fill D6:D50 with the relative (row 5) to 6:50

My current code line (which I need help with is (and it is not working):

With Sheets("Revised-CashOut")
..Range("H5:H50).Formula = "=" & Sheets("Formulas").Range("$D$5").value
&"

Can someone assist me in getting the syntax right?

TIA,

Jim May

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Assigning Formula to a Range

With Sheets("Revised-CashOut")
.Range("H5:H50).Formula = _
Sheets("Formulas").Range("D5").Formula

End With

--
Regards,
Tom Ogilvy



"JMay" wrote:

I have a formula in Cell D5 on SheetName Formulas as follows:

=IF(MID(E5,LEN(E5)-1,1)="A","Kel Tech",IF(MID(E5,LEN(E5)-1,1)="B","South
Star",IF(MID(E5,LEN(E5)-1,1)="C","White
Rodgers",IF(MID(E5,LEN(E5)-1,1)="D","GRI",IF(MID(E5,LEN(E5)-1,1)="E","Graybar",IF(MID(E5,LEN(E5)-1,1)="F","Guest
Room",""))))))

It currently on the Formulas WS shows up as #Value! - but it is exactly
what I need to paste into my Cell D5 on SheetName Revised-CashOut
and actually I need to Fill D6:D50 with the relative (row 5) to 6:50

My current code line (which I need help with is (and it is not working):

With Sheets("Revised-CashOut")
..Range("H5:H50).Formula = "=" & Sheets("Formulas").Range("$D$5").value
&"

Can someone assist me in getting the syntax right?

TIA,

Jim May


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Assigning Formula to a Range

To Clarify:
The Formula in cell D5 was actually Pasted into D5 from H5 on sheet
"Revised-CashOut" Before copying I placed a " ' " in front of the
formula to transpose into text. My sheet Revised-CashOut looses
this formula with various updating that goes on in the sheet, so
that is why I'm trying to replace the formula after everything
settles down on the page. HTH

"JMay" wrote in message
:

I have a formula in Cell D5 on SheetName Formulas as follows:

=IF(MID(E5,LEN(E5)-1,1)="A","Kel Tech",IF(MID(E5,LEN(E5)-1,1)="B","South
Star",IF(MID(E5,LEN(E5)-1,1)="C","White
Rodgers",IF(MID(E5,LEN(E5)-1,1)="D","GRI",IF(MID(E5,LEN(E5)-1,1)="E","Graybar",IF(MID(E5,LEN(E5)-1,1)="F","Guest
Room",""))))))

It currently on the Formulas WS shows up as #Value! - but it is exactly
what I need to paste into my Cell D5 on SheetName Revised-CashOut
and actually I need to Fill D6:D50 with the relative (row 5) to 6:50

My current code line (which I need help with is (and it is not working):

With Sheets("Revised-CashOut")
.Range("H5:H50).Formula = "=" & Sheets("Formulas").Range("$D$5").value
&"

Can someone assist me in getting the syntax right?

TIA,

Jim May


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Assigning Formula to a Range


s = Sheets("Formulas").Range("D5").Formula
s = Replace(s,"=","")
With Sheets("Revised-CashOut")
.Range("H5:H50").Formula = _
"=" & s
End With

--
Regards,
Tom Ogilvy


"JMay" wrote:

To Clarify:
The Formula in cell D5 was actually Pasted into D5 from H5 on sheet
"Revised-CashOut" Before copying I placed a " ' " in front of the
formula to transpose into text. My sheet Revised-CashOut looses
this formula with various updating that goes on in the sheet, so
that is why I'm trying to replace the formula after everything
settles down on the page. HTH

"JMay" wrote in message
:

I have a formula in Cell D5 on SheetName Formulas as follows:

=IF(MID(E5,LEN(E5)-1,1)="A","Kel Tech",IF(MID(E5,LEN(E5)-1,1)="B","South
Star",IF(MID(E5,LEN(E5)-1,1)="C","White
Rodgers",IF(MID(E5,LEN(E5)-1,1)="D","GRI",IF(MID(E5,LEN(E5)-1,1)="E","Graybar",IF(MID(E5,LEN(E5)-1,1)="F","Guest
Room",""))))))

It currently on the Formulas WS shows up as #Value! - but it is exactly
what I need to paste into my Cell D5 on SheetName Revised-CashOut
and actually I need to Fill D6:D50 with the relative (row 5) to 6:50

My current code line (which I need help with is (and it is not working):

With Sheets("Revised-CashOut")
.Range("H5:H50).Formula = "=" & Sheets("Formulas").Range("$D$5").value
&"

Can someone assist me in getting the syntax right?

TIA,

Jim May



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Assigning Formula to a Range

Solved -- Found this Googling - (Thanks Chip Pearson):

Sheets("Revised-CashOut").Range("H5:H50").Formula = _
Sheets("Formulas").Range("D5").Formula

Works Great !!


"JMay" wrote in message
:

I have a formula in Cell D5 on SheetName Formulas as follows:

=IF(MID(E5,LEN(E5)-1,1)="A","Kel Tech",IF(MID(E5,LEN(E5)-1,1)="B","South
Star",IF(MID(E5,LEN(E5)-1,1)="C","White
Rodgers",IF(MID(E5,LEN(E5)-1,1)="D","GRI",IF(MID(E5,LEN(E5)-1,1)="E","Graybar",IF(MID(E5,LEN(E5)-1,1)="F","Guest
Room",""))))))

It currently on the Formulas WS shows up as #Value! - but it is exactly
what I need to paste into my Cell D5 on SheetName Revised-CashOut
and actually I need to Fill D6:D50 with the relative (row 5) to 6:50

My current code line (which I need help with is (and it is not working):

With Sheets("Revised-CashOut")
.Range("H5:H50).Formula = "=" & Sheets("Formulas").Range("$D$5").value
&"

Can someone assist me in getting the syntax right?

TIA,

Jim May




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Assigning Formula to a Range

Thanks Tom;

Score (measured in # of Responces):
msserver 2
cox.net 0

Again thanks,
Jim



"Tom Ogilvy" wrote:


s = Sheets("Formulas").Range("D5").Formula
s = Replace(s,"=","")
With Sheets("Revised-CashOut")
.Range("H5:H50").Formula = _
"=" & s
End With

--
Regards,
Tom Ogilvy


"JMay" wrote:

To Clarify:
The Formula in cell D5 was actually Pasted into D5 from H5 on sheet
"Revised-CashOut" Before copying I placed a " ' " in front of the
formula to transpose into text. My sheet Revised-CashOut looses
this formula with various updating that goes on in the sheet, so
that is why I'm trying to replace the formula after everything
settles down on the page. HTH

"JMay" wrote in message
:

I have a formula in Cell D5 on SheetName Formulas as follows:

=IF(MID(E5,LEN(E5)-1,1)="A","Kel Tech",IF(MID(E5,LEN(E5)-1,1)="B","South
Star",IF(MID(E5,LEN(E5)-1,1)="C","White
Rodgers",IF(MID(E5,LEN(E5)-1,1)="D","GRI",IF(MID(E5,LEN(E5)-1,1)="E","Graybar",IF(MID(E5,LEN(E5)-1,1)="F","Guest
Room",""))))))

It currently on the Formulas WS shows up as #Value! - but it is exactly
what I need to paste into my Cell D5 on SheetName Revised-CashOut
and actually I need to Fill D6:D50 with the relative (row 5) to 6:50

My current code line (which I need help with is (and it is not working):

With Sheets("Revised-CashOut")
.Range("H5:H50).Formula = "=" & Sheets("Formulas").Range("$D$5").value
&"

Can someone assist me in getting the syntax right?

TIA,

Jim May



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
Assigning Variable Range JMay Excel Discussion (Misc queries) 1 July 7th 07 04:52 PM
Assigning set of range names ADB Excel Programming 5 September 25th 05 11:45 AM
Assigning Range to Array Stratuser Excel Programming 3 October 30th 04 01:50 AM
Match / Name-assigning To A Range fabalicious Excel Programming 1 April 8th 04 11:28 AM
Assigning a Range to Alex A Excel Programming 2 January 30th 04 12:50 AM


All times are GMT +1. The time now is 09:49 PM.

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"