I have a range "C1:Cx" where i want x to be the value from a value "overallLastRow". How do I write this?
Thanks
Dave
I have a range "C1:Cx" where i want x to be the value from a value "overallLastRow". How do I write this?
Thanks
Dave
Just a reminder to post to the right group next time.
Maybe
to find last then see linksRange("C1:C" & x)
http://www.rondebruin.nl/last.htm
http://www.ozgrid.com/VBA/ExcelRanges.htm
VBA Noob
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Thanks VBA noob. I have the findlast sorted already.
I am now trying to add a similar piece of code into a more complex section:
Can you tell me how to make x overallLastRow in this instance?Range("A1").FormulaR1C1 = "=IF(ISERROR(MATCH(old!$C$1:$C$x,new!$C$1:$C$x,0)),old!$C$1:$C$x,"")"
Thanks Again
Dave
Instead of FormulaR1C1 try Formula
You may need to post the actual formula but try something like
VBA NoobPlease Login or Register to view this content.
Originally Posted by VBA Noob
I get Run-Time Error '1004'
Application defined or object defined error
I have substituted x for overallLastRow, but have this error.Please Login or Register to view this content.
Your still using the R1C1 format
instead ofPlease Login or Register to view this content.
Please Login or Register to view this content.
Then post the formula as it would be displayed in a cell.You may need to post the actual formula but try something like
VBA Noob
I now have:
Still have the same error.Please Login or Register to view this content.
Which line does it stop at.
See if this helps
VBA NoobPlease Login or Register to view this content.
Ah, thanks. I've spotted it.
See amendment in bold:
Range("A1").Formula = "=IF(ISERROR(MATCH(old!$C$1:$C$" & overallLastRow & ",new!$C$1:$C$" & overallLastRow & " ,0)),old!$C$1:$C$" & overallLastRow & " ,"")"
Range("A1").Formula = "=IF(ISERROR(MATCH(old!$C$1:$C$" & overallLastRow & ",new!$C$1:$C$" & overallLastRow & " ,0)),old!$C$1:$C$" & overallLastRow & " ,"""")"
Glad you got it sorted
Double quotes get you every time.
I usually write the formula then turn on the recorder and enter a ' in front of the formula to get
Then remove the R1C1 and the 'Please Login or Register to view this content.
HTH
VBA Noob
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks