Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / June 2007

Tip: Looking for answers? Try searching our database.

vba variable range in a formula

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fnwcanada@gmail.com - 08 Jun 2007 14:21 GMT
I am trying to enter a formula into a range of cells and in the
formula the row range also has to change.  My error seems to be with
"range1" and it is not returning a cell but says "range1".  Any
ideas???

Dim rw As Integer, range1 As Range, range2 As Range
       For rw = 2 To 8
           Set range1 = ActiveSheet.Cells(rw, 4)
           Set range2 = ActiveSheet.Cells(rw, 6)
               range2.formula = "=SUMPRODUCT(('271500.xls'!
category_271500= " & range1 & ")*('271500.xls'!amount_271500))"
       Next rw
Barb Reinhardt - 08 Jun 2007 15:02 GMT
try using range1.address

> I am trying to enter a formula into a range of cells and in the
> formula the row range also has to change.  My error seems to be with
[quoted text clipped - 8 lines]
> category_271500= " & range1 & ")*('271500.xls'!amount_271500))"
>         Next rw
fnwcanada@gmail.com - 08 Jun 2007 15:10 GMT
On Jun 8, 11:02 am, Barb Reinhardt
<BarbReinha...@discussions.microsoft.com> wrote:
> try using range1.address
>
[quoted text clipped - 13 lines]
>
> - Show quoted text -

Worked perfect Barb.
Cheers,
Nathan Walsh
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.