Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2004

Tip: Looking for answers? Try searching our database.

selection of fields from Excel based on color and outputting the selected fields to new excel sheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
uday - 31 Mar 2004 13:41 GMT
i need to write a visual basic program to perform the analysis of Excel
price list to analyze the line and column headings and copy them along
with the prices into a sheet . the program should react to the colors as
shown .

selection of fields from Excel based on color and outputting the
selected fields to new excel sheet
Dave Peterson - 01 Apr 2004 00:53 GMT
If you record a macro when you change the color, then you'll know what property
your code will have to inspect.

Then you can do things like:

Option Explicit
Sub testme01()
Dim myHeaderRng As Range
Dim myCell As Range
Dim RngToCopy As Range
Dim DestCell As Range

With ActiveSheet
 Set myHeaderRng = .Range("a1:e1")
 For Each myCell In myHeaderRng.Cells
    If myCell.Interior.ColorIndex = 6 Then
        Set RngToCopy _
           = .Range(myCell, .Cells(.Rows.Count, myCell.Column).End(xlUp))
        With Worksheets("Othersheetnamehere")
           Set DestCell _
               = .Cells(1, .Columns.Count).End(xlToLeft).Offset(0, 1)
        End With
        RngToCopy.Copy _
           Destination:=DestCell
    End If
 Next myCell
End With

End Sub

Maybe this'll get you started.

> i need to write a visual basic program to perform the analysis of Excel
> price list to analyze the line and column headings and copy them along
[quoted text clipped - 7 lines]
> Excel Templates, Training & Add-ins.
> Free Excel Forum http://www.ozgrid.com/forum *****

Signature

Dave Peterson
ec35720@msn.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.