Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Macro - cell content left then....

I'm trying to build a macro that will look for any value in each cell in
column Z and then to put a Yes in cell AA.

This needs to work for all cells in column Z were there is any data in the
cell in column A.

He
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Macro - cell content left then....

sub UpdateAA()
Dim r as Range, r1 as Range, c as Range
On error Resume Next
set r = columns("Z").specialCells(xlConstants)
set r1 = columns("Z").SpecialCells(xlFormulas)
On Error goto 0
if not r is nothing then
for each c in r
c.offset(0,1).Value = "Yes"
Next
end if
if not r1 is nothing then
for each c in r1
c.offset(0,1).Value = "Yes"
Next
end if
end Sub

--
regards,
Tom Ogilvy

"Paul Dennis" wrote:

I'm trying to build a macro that will look for any value in each cell in
column Z and then to put a Yes in cell AA.

This needs to work for all cells in column Z were there is any data in the
cell in column A.

He

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Macro - cell content left then....

Will a worksheet function do?

=IF(z1<"",IF(A1<"","Yes",""),"")

Keith

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Macro - cell content left then....

One possible way:

For Each cell In Range("Z1:Z100")
If cell.Value = "Value" _
Then
cell.Offset(0, 1).Value = "Yes"
Else
End If
Next cell



Adjust your range and "Value" as necessary. If you want your "Value" to be
a cell, then:
If cell.Value = Range("A1").value

Hope this helps,
Paul

--

"Paul Dennis" wrote in message
...
I'm trying to build a macro that will look for any value in each cell in
column Z and then to put a Yes in cell AA.

This needs to work for all cells in column Z were there is any data in the
cell in column A.

He



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 look down cells and if negative in the right of the cell change to left of the cell [email protected][_2_] Excel Programming 9 August 7th 07 12:06 PM
How do I get the content of the cell left of the active cell? TimK Excel Programming 1 August 25th 06 11:08 PM
Run Macro after cell content changes... [email protected] Excel Programming 3 July 29th 06 12:14 AM
Macro on cell content Riko Wichmann New Users to Excel 2 March 3rd 05 02:07 PM
Please help! Macro to change cell contents based on cell to the left Jennifer[_8_] Excel Programming 7 March 4th 04 01:06 AM


All times are GMT +1. The time now is 04:11 PM.

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"