Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 6th, 2004, 01:10 PM
Authorized User
 
Join Date: Aug 2003
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Default Offset Formulae

I have a set of data in a particular column. I have named a range with offset formulae as follows :
  =OFFSET(Sheet1!$A$2,0,0,total,1)

Note : First row is the heading(not to be included in the range)
and further have attached this range(listfillrange property) to the listbox.

total counts the number of elements in a column.

It works fine otherwise, but if i try to insert a cell just above my first value the value does'nt come in the range but if i insert a cell after my first value it works fine. I believe i m can do it by changing the reference type but not sure how.

Help will be appreciated.

Ajitpal S Padda
__________________
Ajitpal S Padda
 
Old January 6th, 2004, 01:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 173
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Try

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A$1:$A$1000 )-1,1)
 
Old January 6th, 2004, 01:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 173
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Ooops not quite right, try this:

=OFFSET(OFFSET(Sheet1!$A$1,1,0),0,0,COUNTA(Sheet1! $A$1:$A$1000)-1,1)
 
Old January 6th, 2004, 02:09 PM
Authorized User
 
Join Date: Aug 2003
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks Maccas!! That was real quick and worked perfect.



Ajitpal S Padda





Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined Offset 7thsense101 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 December 9th, 2009 06:49 AM
undefined offset error trev Beginning PHP 9 January 24th, 2007 04:41 AM
How can we use FORMULAE in Access ?? davekrunal46 Access 4 December 6th, 2005 05:27 AM
Notice: Undefined offset: ## Herjan BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 November 27th, 2005 12:29 PM
Converting Excel formulae to VB James Diamond Excel VBA 3 May 11th, 2004 06:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.