Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Macro code to check & copy columns

' This checks "AA" ="" (Empty) and "AB"<"" Not Empty
' when you click on a cell in the AA column

Public Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 27 Then
If Cells(Target.row, "AA").Value = "" And Cells(Target.row, "AB") < ""
Then
Cells(Target.row, "AA") = Cells(Target.row, "B")
MsgBox Str(Target.row) & ":" & Str(Target.Column) & " Nil"
End If
End If
End Sub

' Hope this helps Mercedes
' Andrew

"mercedes" wrote in
message ...
|
| Hello!
| I need some help with a macro code. I'm a beginner who doesn't know
| quite how to do begin. I have records in rows in an Excel spread sheet,
| I need code that would check each record to see if data is present in
| column AB cell. If AB is NOT blank, I need it to check if column AA
| cell is blank. If it is blank, I need it to copy the data from column B
| cell to column AA cell...again only if column AB is not blank and AA is
| blank. Whew! Hope that made sense. Thanks in advance for all your help.
|
|
| --
| mercedes
| ------------------------------------------------------------------------
| mercedes's Profile:
http://www.excelforum.com/member.php...o&userid=24979
| View this thread: http://www.excelforum.com/showthread...hreadid=473634
|


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
Check Box - Macro code Vicky Excel Discussion (Misc queries) 2 March 17th 09 08:28 AM
Use macro to check a range of cells within a row and copy wanted data to new sheet busspeed[_3_] Excel Programming 1 September 29th 04 03:59 PM
Use macro to check a range of cells within a row and copy wanted data to new sheet busspeed[_2_] Excel Programming 0 September 29th 04 03:15 PM
Use macro to check a range of cells within a row and copy wanted data to new sheet busspeed Excel Programming 2 September 29th 04 02:55 PM
check for selected columns in a macro philip watson Excel Programming 1 December 2nd 03 09:48 PM


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