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

I have a sheet called result and It has Products and Machines field
Machines.I am trying to count the number of columns the machines
have.Everytime I insert column my range changes.I have to insert column
if the depending on some validation.Default is two columns.That works
fine.When I insert another column it should give the count as 3 not 2.
I don't know if I should use Dynamic range or not.If I have to please
help me with the code.

See attached document and the code comments,Thanks!!!!

Attachment filename: help.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=633910
---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Dynamic Range

Hi Patty,

Debra Dalgleish has a good intodutory tutorial on dynamic ranges at:

http://www.contextures.com/xlNames01.html#Dynamic


---
Regards,
Norman


"Patty2005 " wrote in message
...
I have a sheet called result and It has Products and Machines field
Machines.I am trying to count the number of columns the machines
have.Everytime I insert column my range changes.I have to insert column
if the depending on some validation.Default is two columns.That works
fine.When I insert another column it should give the count as 3 not 2.
I don't know if I should use Dynamic range or not.If I have to please
help me with the code.

See attached document and the code comments,Thanks!!!!

Attachment filename: help.xls
Download attachment:

http://www.excelforum.com/attachment.php?postid=633910
---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Dynamic Range

Hi,

Sub TEST()

cnt = ActiveSheet.Range("D1").MergeArea.Columns.Count
MsgBox "Number of columns are " & cnt

End Sub


(In your file, D1 is the first cell of columns the Machines have.)


--
Regards,
Soo Cheon Jheong
_ _
^ąŻ^
--



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
Dynamic Range Arnie New Users to Excel 3 June 25th 08 12:46 PM
Dynamic range prakash Excel Discussion (Misc queries) 2 September 11th 06 12:24 PM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
help with dynamic range Shanin Charts and Charting in Excel 1 September 1st 05 09:58 PM
Excel 2000 VBA - Set Print Range in dynamic range sub_pop[_5_] Excel Programming 2 July 27th 04 08:01 PM


All times are GMT +1. The time now is 07:49 AM.

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"