Go Back   Trackpads Community > General Discussions > Computer and Technology > Microsoft Applications

Microsoft Applications Discussions about Windows and other MS Products such as Office

Reply
 
LinkBack Thread Tools
Old 06-16-2004, 00:49   #1 (permalink)
uday
Civilians

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

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

***** Posted via: http://www.ozgrid.com
Excel Templates, Training & Add-ins.
Free Excel Forum http://www.ozgrid.com/forum *****
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Trackpads Information
Click to Visit
Old 06-16-2004, 00:50   #2 (permalink)
Dave Peterson
Civilians

 
Default Re: selection of fields from Excel based on color and outputting theselected fields to new excel sheet

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.


uday wrote:
>
> 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
>
> ***** Posted via: http://www.ozgrid.com
> Excel Templates, Training & Add-ins.
> Free Excel Forum http://www.ozgrid.com/forum *****


--

Dave Peterson
ec35720@msn.com
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
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
how to get the number of days between two date formatted fields in vba for excel? Daniel Microsoft Applications 1 07-12-2005 00:00
Link with Excel and updating fields =?Utf-8?B?UGFub3M=?= Microsoft Applications 2 11-23-2004 16:00
HELP: Access table linked to Excel - calculated fields? K Zox Microsoft Applications 3 11-12-2004 08:00
Analyze Timescale Data in Excel - available fields Verosa Microsoft Applications 4 06-16-2004 17:58
Export Data and populate existing Excel Spreadsheet Fields Wesley H Microsoft Applications 3 06-16-2004 01:09


Community Information
Options
Quick Options
Trackpads Non-Commercial Ad
Copyright Information Click to Visit
Time
Server Time
All times are GMT -4. The time now is 11:21.
Copyright
Copyright Information
The header is based off of work by Vipixel.com and modified by this site. Trackpads and the Trackpads Logo are both Registered Trademarks of Jason Edwards and cannot be used without prior written permission.  The only exception is as a link back to this site. Trackpads is a private website run by a small legion of volunteers, 3 dogs, 12.5 cats and an army of small, super smart, bio-engineered mice with pointy hats and tutu's. Search Engine Friendly URLs by vBSEO 3.2.0 RC7
Archive Links
Archive Links
Page generated in 0.55950 seconds with 19 queries