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

I am not sure if this is possible or not, probably is, but i'm still
beginner in the world of macros. Gotta love your bosses!!
What I'm trying to do, is take a productivity report, and color cod
the different values. I already have the macro written for this
however, my problem lays within the coloumns themselves. In on
coloumn I have two sets of data, that I want to run two macros on.
(ie. Macro1 for B1:B8 & Macro2 for B10:B15). The data for Macro1 wil
not always be B1:B8. It varies from day to day. The last data inpu
though is always automatically color coded light yellow. And th
second set of data always begins 2 cells below the last cell of th
previous.

So my question is, can I create a macro that will run Macro1 on cell
B1:B(light yellow) and Macro2 on cells B(light yellow + 2 cells):B?

If it's possible and someone can help me out I will be mos
appreciative. THANKS!!! :

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Multiple coloumns data

Set rng = Columns(2).SpecialCells(xlConstants)
if rng.Areas.count 2 then exit sub
i = 0
for each ar in rng.Areas
i = i + 1
if i = 1 then
macro1 ar
else
macro2 ar
end if
Next

However, if you colored them, you should be able to identify where to start

Why not post under a single Name.

--
Regards,
Tom Ogilvy


"dok112 " wrote in message
...
I am not sure if this is possible or not, probably is, but i'm still a
beginner in the world of macros. Gotta love your bosses!!
What I'm trying to do, is take a productivity report, and color code
the different values. I already have the macro written for this,
however, my problem lays within the coloumns themselves. In one
coloumn I have two sets of data, that I want to run two macros on.
(ie. Macro1 for B1:B8 & Macro2 for B10:B15). The data for Macro1 will
not always be B1:B8. It varies from day to day. The last data input
though is always automatically color coded light yellow. And the
second set of data always begins 2 cells below the last cell of the
previous.

So my question is, can I create a macro that will run Macro1 on cells
B1:B(light yellow) and Macro2 on cells B(light yellow + 2 cells):B?

If it's possible and someone can help me out I will be most
appreciative. THANKS!!! :)


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple coloumns data

Tom,

Thanks for your help. It's a matter of me using my computer from work
home or my laptop on the road. Sorry about the confusion. When I'
home, I go completely brain dead about passwords from work, so I end u
creating all new accounts.

Kind of have an issue. I was going back over what you said, an
checked it against my document, and realized that I was mistaken. It'
not two sets of data in one column that need to have 2 macros run on.
It is actually 2 sets of data and either the first set, or the secon
set need to have a certain macro run on it for the formatting. Th
amount of data for each set varies on a daily basis. The heading tha
starts each set is the only constant that will not change. Would I us
the same code that was provided before, or is there another way t
start it.

ie.
Idle
Hours
0:03:39
0:03:33
0:01:49
0:02:06
0:04:41
0:06:41
0:01:04
0:08:31
0:03:55


0:35:59



Call Control

0:08:40
0:09:04
0:06:02
0:15:50
0:09:11
0:07:18
0:07:05
0:08:05
0:15:50


0:08:41

I would want macro AHT to begin in the blank box right below the cel
stating Call Control and end in the cell (0:08:41) which is coded i
light yellow by the report itself.

Thanks again for all the help provided

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Multiple coloumns data

Dim rng as Range
set rng = cells.find("Call Control")
if not rng is nothing then
set rng = rng.offset(1,0)
set rng = range(rng, rng.offset(1,0).End(xldown)(4))
for each cell in rng
cell.Select
AHT
Next
End if

the last cell will always have 2 blank cells separating it from the data
above
AHT works on the ActiveCell so it must be called for each

If you have to search for the cell with light yellow, then the term light
yellow is not self defining. You would need to provide the colorindex and
whether this is the only cell in the sheet so coded.

--
Regards,
Tom Ogilvy

"dok112 " wrote in message
...
Tom,

Thanks for your help. It's a matter of me using my computer from work,
home or my laptop on the road. Sorry about the confusion. When I'm
home, I go completely brain dead about passwords from work, so I end up
creating all new accounts.

Kind of have an issue. I was going back over what you said, and
checked it against my document, and realized that I was mistaken. It's
not two sets of data in one column that need to have 2 macros run on.
It is actually 2 sets of data and either the first set, or the second
set need to have a certain macro run on it for the formatting. The
amount of data for each set varies on a daily basis. The heading that
starts each set is the only constant that will not change. Would I use
the same code that was provided before, or is there another way to
start it.

ie.
Idle
Hours
0:03:39
0:03:33
0:01:49
0:02:06
0:04:41
0:06:41
0:01:04
0:08:31
0:03:55


0:35:59



Call Control

0:08:40
0:09:04
0:06:02
0:15:50
0:09:11
0:07:18
0:07:05
0:08:05
0:15:50


0:08:41

I would want macro AHT to begin in the blank box right below the cell
stating Call Control and end in the cell (0:08:41) which is coded in
light yellow by the report itself.

Thanks again for all the help provided.


---
Message posted from http://www.ExcelForum.com/



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
Chart to display multiple variables in 2 different coloumns LLively Charts and Charting in Excel 2 July 3rd 09 01:32 AM
Sorting Coloumns that are Formula's heritage1450 Excel Worksheet Functions 1 June 25th 09 05:37 PM
How do COUNTIF from two different coloumns but not all rows? JP Excel Worksheet Functions 1 December 16th 08 01:47 AM
data entered in each coloumns of one sheet to be extracted with r. rrenga72 Excel Discussion (Misc queries) 0 March 6th 08 09:51 PM
FILTER applied to many coloumns [email protected] Excel Discussion (Misc queries) 0 September 12th 06 09:52 AM


All times are GMT +1. The time now is 09:12 PM.

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"