Solved

A better way to make this equation?

Posted on 2014-03-25
1
242 Views
Last Modified: 2014-03-25
Quick form question:

Assuming all the variables are defined correctly and If we have –

i = cCell.row
addr = cCell.Address

With wsBas

      .Range(addr).Offset(0,-25).Value = wsQot.Cells(i, “V”).Value


Is there a way to make the left hand side of the equation in the same form as the right hand side of the equation?  

In other words, using the offset and counting it all out is getting burdensome.  Is there a way to reference the columns instead of the offset?   Much easier I think.  

Example:

Could it be?...

With wsBas
      
      Cells(i, “AA”).Value = wsQot.Cells(i, “V”).Value

...or some other similar form?

thanks!
0
Comment
Question by:BostonBob
1 Comment
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 39954647
You can indeed use

Cells(i, “AA”).Value = wsQot.Cells(i, “V”).Value

but since you're not starting with the ., you're not picking up the parent. YOu might need to if wsbas is not the activesheet.

wsbas.Cells(ccell.row, “AA”).Value = wsQot.Cells(i, “V”).Value

you can also use

wsbas.range("AA" & i).value
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question