Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello!
I need some help with a macro code for excel. 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 AA 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 (if AB is blank, it shouldn't do anything). Hope that made sense. Thanks in advance for all your help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() For i = 1 To Cells(Rows.Count,"AB").End(xlUp).Row If Cells(i,"AB").Value < "" Then If Cells(i,"AA").Value = "" Then Cells(i,"AA"),value = Cells(i,"B").Value End If End If Next i -- HTH Bob Phillips wrote in message ups.com... Hello! I need some help with a macro code for excel. 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 AA 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 (if AB is blank, it shouldn't do anything). Hope that made sense. Thanks in advance for all your help. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, Bob! Thanks for the help. I tried your code but got the
following error Compile error: syntax error on the Cells(i,"AA"),value = Cells(i,"B").Value line Any ideas on how to fix? Thanks! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It was a typo:
Cells(i,"AA"),value should have been: Cells(i,"AA").Value wrote: Hello, Bob! Thanks for the help. I tried your code but got the following error Compile error: syntax error on the Cells(i,"AA"),value = Cells(i,"B").Value line Any ideas on how to fix? Thanks! -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried fixing the typo but I'm getting the same error on the same
line. Any ideas? thanks! Dave Peterson wrote: It was a typo: Cells(i,"AA"),value should have been: Cells(i,"AA").Value wrote: Hello, Bob! Thanks for the help. I tried your code but got the following error Compile error: syntax error on the Cells(i,"AA"),value = Cells(i,"B").Value line Any ideas on how to fix? Thanks! -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Juts tested it with the typo fixed, works as I read the requiremnet.
-- HTH Bob Phillips wrote in message oups.com... I tried fixing the typo but I'm getting the same error on the same line. Any ideas? thanks! Dave Peterson wrote: It was a typo: Cells(i,"AA"),value should have been: Cells(i,"AA").Value wrote: Hello, Bob! Thanks for the help. I tried your code but got the following error Compile error: syntax error on the Cells(i,"AA"),value = Cells(i,"B").Value line Any ideas on how to fix? Thanks! -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting code from a macro (by a macro) | Excel Discussion (Misc queries) | |||
read macro code by vb code | Excel Programming | |||
do anybody have a sample code for executing excel macro from vb code?<eom | Excel Programming | |||
Macro copying macro code | Excel Programming | |||
Macro to change Macro code? | Excel Programming |