#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default loop macro


Hi, i'm new in this forum and Looking for some help...

I need a macro to make a list of the fiber color code, starting by th
color in the selected cell and keep repeating in a row as many times i
specified in another cell (A2).

The color code is

Blue
Orange
Green
Brown
Grey
White
Red
Black
Yellow
Violet
Rose
Aqua

This is the fiber color code, and after aqua start over whit blu
again.
there is any way to do this.

thank yo

--
caciqu
-----------------------------------------------------------------------
cacique's Profile: http://www.excelforum.com/member.php...fo&userid=2486
View this thread: http://www.excelforum.com/showthread.php?threadid=38405

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default loop macro

Hi,
Is the selected cell always in the same column? And can you give an
example of the sequence i.e can it start with any colour: is the following
valid?

Violet, Rose,Aqua, Blue, ...Yellow,Violet ...

"cacique" wrote:


Hi, i'm new in this forum and Looking for some help...

I need a macro to make a list of the fiber color code, starting by the
color in the selected cell and keep repeating in a row as many times is
specified in another cell (A2).

The color code is

Blue
Orange
Green
Brown
Grey
White
Red
Black
Yellow
Violet
Rose
Aqua

This is the fiber color code, and after aqua start over whit blue
again.
there is any way to do this.

thank you


--
cacique
------------------------------------------------------------------------
cacique's Profile: http://www.excelforum.com/member.php...o&userid=24861
View this thread: http://www.excelforum.com/showthread...hreadid=384058


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default loop macro


hi and thanks for the help,

yes and yes.

the selected cell is allways the same and the sequence can start with
any color..


--
cacique
------------------------------------------------------------------------
cacique's Profile: http://www.excelforum.com/member.php...o&userid=24861
View this thread: http://www.excelforum.com/showthread...hreadid=384058

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default loop macro

Is this what you are saying? You will enter a number in Cell A2 that
represents the number of fibers to list per row. At the beginning of that
row you have already entered a starting color. So if you select A12 which
has Grey in it and there is a 4 in A2, you want the next 4 colors in B12 to
E12? White through Yellow. That would be 5 fibers in that row. Do you also
want to indicate the Tube color, Bundle color, etc.? Because when you use up
the first 12 fibers the Tube color changes to Orange, and when you have used
12 Tubes (144 fibers) then the Bundle changes to Orange. Or do you not care
about which Tube, Bundle the fiber is in, you just want the fiber colors to
loop from a starting point on each row.

Mike F
Cable Guy

"cacique" wrote in
message ...

Hi, i'm new in this forum and Looking for some help...

I need a macro to make a list of the fiber color code, starting by the
color in the selected cell and keep repeating in a row as many times is
specified in another cell (A2).

The color code is

Blue
Orange
Green
Brown
Grey
White
Red
Black
Yellow
Violet
Rose
Aqua

This is the fiber color code, and after aqua start over whit blue
again.
there is any way to do this.

thank you


--
cacique
------------------------------------------------------------------------
cacique's Profile:
http://www.excelforum.com/member.php...o&userid=24861
View this thread: http://www.excelforum.com/showthread...hreadid=384058



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default loop macro


hi, Mike


yes that's what I want.

the Tube or ribbon color change, will be using the same formula but
with different number source from different cell.

I think, I can figure out after i have the macro to loop the colors


--
cacique
------------------------------------------------------------------------
cacique's Profile: http://www.excelforum.com/member.php...o&userid=24861
View this thread: http://www.excelforum.com/showthread...hreadid=384058



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default loop macro


Any One that can help me!!
thanks!!!


--
cacique
------------------------------------------------------------------------
cacique's Profile: http://www.excelforum.com/member.php...o&userid=24861
View this thread: http://www.excelforum.com/showthread...hreadid=384058

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default loop macro

OK, this macro uses Excels Auto_Fill from a list feature, so you will need
to create a Custom List of the fiber colors. You do that in
Tools/Options/Custom Lists. Once you have that, put this code in a general
module. Assign it to a worksheet button if you wish for ease of use.

Sub Paste_fibers()

Dim fromhere As String
Dim tohere As String
Dim fibcnt As Long

fibcnt = Range("A2").Value
fromhere = ActiveCell.Address
tohere = ActiveCell.Offset(0, fibcnt).Address
Selection.AutoFill Destination:=Range(fromhere & ":" & tohere)

End Sub

Mike F
"cacique" wrote in
message ...

Any One that can help me!!
thanks!!!


--
cacique
------------------------------------------------------------------------
cacique's Profile:
http://www.excelforum.com/member.php...o&userid=24861
View this thread: http://www.excelforum.com/showthread...hreadid=384058



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default loop macro

I would think that you would want to include the starting fiber in the fiber
count for the row. In other words, if you have a 6 in A2 you would want only
6 fibers in that row, which would include the starting fiber, so the macro
should only add 5 more for a total of 6. If so, modify one line like this:

fibcnt = Range("A2").Value - 1

That will make "tohere" one column shorter.

Mike F

"Mike Fogleman" wrote in message
...
OK, this macro uses Excels Auto_Fill from a list feature, so you will need
to create a Custom List of the fiber colors. You do that in
Tools/Options/Custom Lists. Once you have that, put this code in a general
module. Assign it to a worksheet button if you wish for ease of use.

Sub Paste_fibers()

Dim fromhere As String
Dim tohere As String
Dim fibcnt As Long

fibcnt = Range("A2").Value
fromhere = ActiveCell.Address
tohere = ActiveCell.Offset(0, fibcnt).Address
Selection.AutoFill Destination:=Range(fromhere & ":" & tohere)

End Sub

Mike F
"cacique" wrote in
message ...

Any One that can help me!!
thanks!!!


--
cacique
------------------------------------------------------------------------
cacique's Profile:
http://www.excelforum.com/member.php...o&userid=24861
View this thread:
http://www.excelforum.com/showthread...hreadid=384058





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
macro loop DM Excel Discussion (Misc queries) 1 January 3rd 06 10:46 PM
how can i loop a macro Remote help Excel Discussion (Misc queries) 1 July 21st 05 02:57 AM
Do...Loop Macro Cass Excel Programming 2 May 14th 04 07:14 PM
Help With loop macro?? pauluk[_28_] Excel Programming 1 April 16th 04 01:58 AM
Loop macro help. Pete[_13_] Excel Programming 2 November 14th 03 10:32 PM


All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"