Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheetfunctions,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default VBA or Macro to Update Column

Excel 2000

Does anyone have some code that would go through a range of cells on
worksheet A and then search a range of cells in worksheet B and if it
found a match (these would be matching dates) it would change the cell
colors of that cell's column and update a different cell in the column
with text from worksheet A.

e.g.
Worksheet A has the following data
A1 - Birthday A2 - 1/6/04

In worksheet B when the macro is run (on a button trigger) it would
look for the date 1/6/04 in row 2. When it is found, let's say it is
found at cell P2, it would first change the fill color to yellow for
column P and then put the text Birthday in cell P5.

I wouldn't mind working it out, but I'm having trouble finding a good
reference. The http://support.microsoft.com/support...01/default.asp
document is no longer available.

Thanks,

Carolyn
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheetfunctions,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 27,285
Default VBA or Macro to Update Column

Sub MarkDate()
Dim dt As Long
Dim desc As String
Dim rng As Range, rng1 As Range, res As Variant
Dim cell As Range
Set rng = Worksheets("WorksheetA").Range("A2")
dt = rng.Value
desc = rng.Offset(-1, 0).Value
Set rng1 = Worksheets("WorksheetB").Rows(2).Cells
res = Application.Match(dt, rng1, 0)
If Not IsError(res) Then
Set cell = rng1(1, res)
cell.EntireColumn.Interior.ColorIndex = 6
cell.Offset(3, 0).Value = desc
Else
MsgBox rng.Text & " not found"
End If
End Sub

http://msdn.microsoft.com/office/und.../odc_super.asp

URL should all be on one line (you can fix it in notepad). Then paste it
into your browser navigation Textbox.

--
Regards,
Tom Ogilvy



"Carolyn" wrote in message
om...
Excel 2000

Does anyone have some code that would go through a range of cells on
worksheet A and then search a range of cells in worksheet B and if it
found a match (these would be matching dates) it would change the cell
colors of that cell's column and update a different cell in the column
with text from worksheet A.

e.g.
Worksheet A has the following data
A1 - Birthday A2 - 1/6/04

In worksheet B when the macro is run (on a button trigger) it would
look for the date 1/6/04 in row 2. When it is found, let's say it is
found at cell P2, it would first change the fill color to yellow for
column P and then put the text Birthday in cell P5.

I wouldn't mind working it out, but I'm having trouble finding a good
reference. The

http://support.microsoft.com/support...01/default.asp
document is no longer available.

Thanks,

Carolyn



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 to update a column in a work based on another work sheet WickerMan New Users to Excel 1 December 4th 09 12:58 PM
Update column H based upon content in column B EllenM Excel Worksheet Functions 2 June 5th 08 11:52 AM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
how do I update a column and create new rows for new column cells Pete Excel Discussion (Misc queries) 1 June 6th 07 02:02 AM
How do I update Column #1 based on specific value of column #2? SLH Excel Worksheet Functions 2 September 20th 05 02:16 PM


All times are GMT +1. The time now is 07:47 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"