Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Macro
Help I am writing a Macro in excel an have a problem.
I need to check a Section of Cells for Values (O4:R4). If there is a Value continue. If NO Value then Delete Cells (A4:W4). I cannot delete the Whole Row because there is data in other cells (AA4:AW4). Cells X4, Y4 and Z4 are are open and unused. once complete I will use this to check other cells in this Row as well as other Rows. (A4:W4) (AA4:AW4) (BA4:BW4) (CA4:CW4) (DA4:DW4) Any help would be appreciated |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Macro
Try:
Sub gsnu() Dim r1 As Range, r2 As Range Set r1 = Range("O4:R4") Set r2 = Range("A4:W4") If Application.CountA(r1) = 0 Then r2.Delete End If End Sub -- Gary's Student "VexedFist" wrote: Help I am writing a Macro in excel an have a problem. I need to check a Section of Cells for Values (O4:R4). If there is a Value continue. If NO Value then Delete Cells (A4:W4). I cannot delete the Whole Row because there is data in other cells (AA4:AW4). Cells X4, Y4 and Z4 are are open and unused. once complete I will use this to check other cells in this Row as well as other Rows. (A4:W4) (AA4:AW4) (BA4:BW4) (CA4:CW4) (DA4:DW4) Any help would be appreciated |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Macro
Thank you,
One follow-Up question. I also need to set thru the rows(2 thru 26) for each Range. Is there any way to simplify this a little more? Below are all of the Ranges and rows i need to step thru. O2:O2 for A2:W2 AO2:AR2 for AA2:AW2 BO2:BR2 for BA2:BW2 CO2:CR2 for CA2:CW2 DO2:DR2 for DA2:DW2 O3:O3 for A3:W3 AO3:AR3 for AA3:AW3 BO3:BR3 for BA3:BW3 CO3:CR3 for CA3:CW3 DO3:DR3 for DA3:DW3 O4:O4 for A4:W4 AO4:AR4 for AA4:AW4 BO4:BR4 for BA4:BW4 CO4:CR4 for CA4:CW4 DO4:DR4 for DA4:DW4 O5:O5 for A5:W5 AO5:AR5 for AA5:AW5 BO5:BR5 for BA5:BW5 CO5:CR5 for CA5:CW5 DO5:DR5 for DA5:DW5 O6:O6 for A6:W6 AO6:AR6 for AA6:AW6 BO6:BR6 for BA6:BW6 CO6:CR6 for CA6:CW6 DO6:DR6 for DA6:DW6 O7:O7 for A7:W7 AO7:AR7 for AA7:AW7 BO7:BR7 for BA7:BW7 CO7:CR7 for CA7:CW7 DO7:DR7 for DA7:DW7 O8:O8 for A8:W8 AO8:AR8 for AA8:AW8 BO8:BR8 for BA8:BW8 CO8:CR8 for CA8:CW8 DO8:DR8 for DA8:DW8 O9:O9 for A9:W9 AO9:AR9 for AA9:AW9 BO9:BR9 for BA9:BW9 CO9:CR9 for CA9:CW9 DO9:DR9 for DA9:DW9 O10:O10 for A10:W10 AO10:AR10 for AA10:AW10 BO10:BR10 for BA10:BW10 CO10:CR10 for CA10:CW10 DO10:DR10 for DA10:DW10 O11:O11 for A11:W11 AO11:AR11 for AA11:AW11 BO11:BR11 for BA11:BW11 CO11:CR11 for CA11:CW11 DO11:DR11 for DA11:DW11 O12:O12 for A12:W12 AO12:AR12 for AA12:AW12 BO12:BR12 for BA12:BW12 CO12:CR12 for CA12:CW12 BO12:DR12 for DA12:DW12 O13:O13 for A13:W13 AO13:AR13 for AA13:AW13 BO13:BR13 for BA13:BW13 CO13:CR13 for CA13:CW13 DO13:DR13 for DA13:DW13 O14:O14 for A14:W14 AO14:AR14 for AA14:AW14 BO14:BR14 for BA14:BW14 CO14:CR14 for CA14:CW14 DO14:DR14 for DA14:DW14 O15:O15 for A15:W15 AO15:AR15 for AA15:AW15 BO15:BR15 for BA15:BW15 CO15:CR15 for CA15:CW15 DO15:DR15 for DA15:DW15 O16:O16 for A16:W16 AO16:AR16 for AA16:AW16 BO16:BR16 for BA16:BW16 CO16:CR16 for CA16:CW16 DO16:DR16 for DA16:DW16 O17:O17 for A17:W17 AO17:AR17 for AA17:AW17 BO17:BR17 for BA17:BW17 CO17:CR17 for CA17:CW17 DO17:DR17 for DA17:DW17 O18:O18 for A18:W18 AO18:AR18 for AA18:AW18 BO18:BR18 for BA18:BW18 CO18:CR18 for CA18:CW18 DO18:DR18 for DA18:DW18 O19:O19 for A19:W19 AO19:AR19 for AA19:AW19 BO19:BR19 for BA19:BW19 CO19:CR19 for CA19:CW19 DO19:DR19 for DA19:DW19 O20:O20 for A20:W20 AO20:AR20 for AA20:AW20 BO20:BR20 for BA20:BW20 CO20:CR20 for CA20:CW20 DO20:DR20 for DA20:DW20 O21:O21 for A21:W21 AO21:AR21 for AA21:AW21 BO21:BR21 for BA21:BW21 CO21:CR21 for CA21:CW21 DO21:DR21 for DA21:DW21 O22:O22 for A22:W22 AO22:AR22 for AA22:AW22 BO22:BR22 for BA22:BW22 CO22:CR22 for CA22:CW22 BO22:DR22 for DA22:DW22 O23:O23 for A23:W23 AO23:AR23 for AA23:AW23 BO23:BR23 for BA23:BW23 CO23:CR23 for CA23:CW23 DO23:DR23 for DA23:DW23 O24:O24 for A24:W24 AO24:AR24 for AA24:AW24 BO24:BR24 for BA24:BW24 CO24:CR24 for CA24:CW24 DO24:DR24 for DA24:DW24 O25:O25 for A25:W25 AO25:AR25 for AA25:AW25 BO25:BR25 for BA25:BW25 CO25:CR25 for CA25:CW25 DO25:DR25 for DA25:DW25 O26:O26 for A26:W26 AO26:AR26 for AA26:AW26 BO26:BR26 for BA26:BW26 CO26:CR26 for CA26:CW26 DO26:DR26 for DA26:DW26 ANY IDEA's Gary''s Student wrote: Try: Sub gsnu() Dim r1 As Range, r2 As Range Set r1 = Range("O4:R4") Set r2 = Range("A4:W4") If Application.CountA(r1) = 0 Then r2.Delete End If End Sub -- Gary's Student "VexedFist" wrote: Help I am writing a Macro in excel an have a problem. I need to check a Section of Cells for Values (O4:R4). If there is a Value continue. If NO Value then Delete Cells (A4:W4). I cannot delete the Whole Row because there is data in other cells (AA4:AW4). Cells X4, Y4 and Z4 are are open and unused. once complete I will use this to check other cells in this Row as well as other Rows. (A4:W4) (AA4:AW4) (BA4:BW4) (CA4:CW4) (DA4:DW4) Any help would be appreciated |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Macro
Sub CheckData()
Dim i As Long, j As Long For i = 2 To 26 For j = 15 To 119 Step 26 If Application.CountA(Cells(i, j).Resize(1, 4)) = 0 Then Cells(i, j).Offset(0, -14).Resize(1, 23).ClearContents End If Next Next End Sub I assume by delete you just want to clear any values in those cells. -- Regards, Tom Ogilvy "VexedFist" wrote in message oups.com... Thank you, One follow-Up question. I also need to set thru the rows(2 thru 26) for each Range. Is there any way to simplify this a little more? Below are all of the Ranges and rows i need to step thru. O2:O2 for A2:W2 AO2:AR2 for AA2:AW2 BO2:BR2 for BA2:BW2 CO2:CR2 for CA2:CW2 DO2:DR2 for DA2:DW2 O3:O3 for A3:W3 AO3:AR3 for AA3:AW3 BO3:BR3 for BA3:BW3 CO3:CR3 for CA3:CW3 DO3:DR3 for DA3:DW3 O4:O4 for A4:W4 AO4:AR4 for AA4:AW4 BO4:BR4 for BA4:BW4 CO4:CR4 for CA4:CW4 DO4:DR4 for DA4:DW4 O5:O5 for A5:W5 AO5:AR5 for AA5:AW5 BO5:BR5 for BA5:BW5 CO5:CR5 for CA5:CW5 DO5:DR5 for DA5:DW5 O6:O6 for A6:W6 AO6:AR6 for AA6:AW6 BO6:BR6 for BA6:BW6 CO6:CR6 for CA6:CW6 DO6:DR6 for DA6:DW6 O7:O7 for A7:W7 AO7:AR7 for AA7:AW7 BO7:BR7 for BA7:BW7 CO7:CR7 for CA7:CW7 DO7:DR7 for DA7:DW7 O8:O8 for A8:W8 AO8:AR8 for AA8:AW8 BO8:BR8 for BA8:BW8 CO8:CR8 for CA8:CW8 DO8:DR8 for DA8:DW8 O9:O9 for A9:W9 AO9:AR9 for AA9:AW9 BO9:BR9 for BA9:BW9 CO9:CR9 for CA9:CW9 DO9:DR9 for DA9:DW9 O10:O10 for A10:W10 AO10:AR10 for AA10:AW10 BO10:BR10 for BA10:BW10 CO10:CR10 for CA10:CW10 DO10:DR10 for DA10:DW10 O11:O11 for A11:W11 AO11:AR11 for AA11:AW11 BO11:BR11 for BA11:BW11 CO11:CR11 for CA11:CW11 DO11:DR11 for DA11:DW11 O12:O12 for A12:W12 AO12:AR12 for AA12:AW12 BO12:BR12 for BA12:BW12 CO12:CR12 for CA12:CW12 BO12:DR12 for DA12:DW12 O13:O13 for A13:W13 AO13:AR13 for AA13:AW13 BO13:BR13 for BA13:BW13 CO13:CR13 for CA13:CW13 DO13:DR13 for DA13:DW13 O14:O14 for A14:W14 AO14:AR14 for AA14:AW14 BO14:BR14 for BA14:BW14 CO14:CR14 for CA14:CW14 DO14:DR14 for DA14:DW14 O15:O15 for A15:W15 AO15:AR15 for AA15:AW15 BO15:BR15 for BA15:BW15 CO15:CR15 for CA15:CW15 DO15:DR15 for DA15:DW15 O16:O16 for A16:W16 AO16:AR16 for AA16:AW16 BO16:BR16 for BA16:BW16 CO16:CR16 for CA16:CW16 DO16:DR16 for DA16:DW16 O17:O17 for A17:W17 AO17:AR17 for AA17:AW17 BO17:BR17 for BA17:BW17 CO17:CR17 for CA17:CW17 DO17:DR17 for DA17:DW17 O18:O18 for A18:W18 AO18:AR18 for AA18:AW18 BO18:BR18 for BA18:BW18 CO18:CR18 for CA18:CW18 DO18:DR18 for DA18:DW18 O19:O19 for A19:W19 AO19:AR19 for AA19:AW19 BO19:BR19 for BA19:BW19 CO19:CR19 for CA19:CW19 DO19:DR19 for DA19:DW19 O20:O20 for A20:W20 AO20:AR20 for AA20:AW20 BO20:BR20 for BA20:BW20 CO20:CR20 for CA20:CW20 DO20:DR20 for DA20:DW20 O21:O21 for A21:W21 AO21:AR21 for AA21:AW21 BO21:BR21 for BA21:BW21 CO21:CR21 for CA21:CW21 DO21:DR21 for DA21:DW21 O22:O22 for A22:W22 AO22:AR22 for AA22:AW22 BO22:BR22 for BA22:BW22 CO22:CR22 for CA22:CW22 BO22:DR22 for DA22:DW22 O23:O23 for A23:W23 AO23:AR23 for AA23:AW23 BO23:BR23 for BA23:BW23 CO23:CR23 for CA23:CW23 DO23:DR23 for DA23:DW23 O24:O24 for A24:W24 AO24:AR24 for AA24:AW24 BO24:BR24 for BA24:BW24 CO24:CR24 for CA24:CW24 DO24:DR24 for DA24:DW24 O25:O25 for A25:W25 AO25:AR25 for AA25:AW25 BO25:BR25 for BA25:BW25 CO25:CR25 for CA25:CW25 DO25:DR25 for DA25:DW25 O26:O26 for A26:W26 AO26:AR26 for AA26:AW26 BO26:BR26 for BA26:BW26 CO26:CR26 for CA26:CW26 DO26:DR26 for DA26:DW26 ANY IDEA's Gary''s Student wrote: Try: Sub gsnu() Dim r1 As Range, r2 As Range Set r1 = Range("O4:R4") Set r2 = Range("A4:W4") If Application.CountA(r1) = 0 Then r2.Delete End If End Sub -- Gary's Student "VexedFist" wrote: Help I am writing a Macro in excel an have a problem. I need to check a Section of Cells for Values (O4:R4). If there is a Value continue. If NO Value then Delete Cells (A4:W4). I cannot delete the Whole Row because there is data in other cells (AA4:AW4). Cells X4, Y4 and Z4 are are open and unused. once complete I will use this to check other cells in this Row as well as other Rows. (A4:W4) (AA4:AW4) (BA4:BW4) (CA4:CW4) (DA4:DW4) Any help would be appreciated |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Macro
Tom,
I need to DELETE Cells A2:W2 If there is NO data in cells O2:R2 Range("A2:W2").Delete shift:=xlUp Any Ideas? Tom Ogilvy wrote: Sub CheckData() Dim i As Long, j As Long For i = 2 To 26 For j = 15 To 119 Step 26 If Application.CountA(Cells(i, j).Resize(1, 4)) = 0 Then Cells(i, j).Offset(0, -14).Resize(1, 23).ClearContents End If Next Next End Sub I assume by delete you just want to clear any values in those cells. -- Regards, Tom Ogilvy "VexedFist" wrote in message oups.com... Thank you, One follow-Up question. I also need to set thru the rows(2 thru 26) for each Range. Is there any way to simplify this a little more? Below are all of the Ranges and rows i need to step thru. O2:O2 for A2:W2 AO2:AR2 for AA2:AW2 BO2:BR2 for BA2:BW2 CO2:CR2 for CA2:CW2 DO2:DR2 for DA2:DW2 O3:O3 for A3:W3 AO3:AR3 for AA3:AW3 BO3:BR3 for BA3:BW3 CO3:CR3 for CA3:CW3 DO3:DR3 for DA3:DW3 O4:O4 for A4:W4 AO4:AR4 for AA4:AW4 BO4:BR4 for BA4:BW4 CO4:CR4 for CA4:CW4 DO4:DR4 for DA4:DW4 O5:O5 for A5:W5 AO5:AR5 for AA5:AW5 BO5:BR5 for BA5:BW5 CO5:CR5 for CA5:CW5 DO5:DR5 for DA5:DW5 O6:O6 for A6:W6 AO6:AR6 for AA6:AW6 BO6:BR6 for BA6:BW6 CO6:CR6 for CA6:CW6 DO6:DR6 for DA6:DW6 O7:O7 for A7:W7 AO7:AR7 for AA7:AW7 BO7:BR7 for BA7:BW7 CO7:CR7 for CA7:CW7 DO7:DR7 for DA7:DW7 O8:O8 for A8:W8 AO8:AR8 for AA8:AW8 BO8:BR8 for BA8:BW8 CO8:CR8 for CA8:CW8 DO8:DR8 for DA8:DW8 O9:O9 for A9:W9 AO9:AR9 for AA9:AW9 BO9:BR9 for BA9:BW9 CO9:CR9 for CA9:CW9 DO9:DR9 for DA9:DW9 O10:O10 for A10:W10 AO10:AR10 for AA10:AW10 BO10:BR10 for BA10:BW10 CO10:CR10 for CA10:CW10 DO10:DR10 for DA10:DW10 O11:O11 for A11:W11 AO11:AR11 for AA11:AW11 BO11:BR11 for BA11:BW11 CO11:CR11 for CA11:CW11 DO11:DR11 for DA11:DW11 O12:O12 for A12:W12 AO12:AR12 for AA12:AW12 BO12:BR12 for BA12:BW12 CO12:CR12 for CA12:CW12 BO12:DR12 for DA12:DW12 O13:O13 for A13:W13 AO13:AR13 for AA13:AW13 BO13:BR13 for BA13:BW13 CO13:CR13 for CA13:CW13 DO13:DR13 for DA13:DW13 O14:O14 for A14:W14 AO14:AR14 for AA14:AW14 BO14:BR14 for BA14:BW14 CO14:CR14 for CA14:CW14 DO14:DR14 for DA14:DW14 O15:O15 for A15:W15 AO15:AR15 for AA15:AW15 BO15:BR15 for BA15:BW15 CO15:CR15 for CA15:CW15 DO15:DR15 for DA15:DW15 O16:O16 for A16:W16 AO16:AR16 for AA16:AW16 BO16:BR16 for BA16:BW16 CO16:CR16 for CA16:CW16 DO16:DR16 for DA16:DW16 O17:O17 for A17:W17 AO17:AR17 for AA17:AW17 BO17:BR17 for BA17:BW17 CO17:CR17 for CA17:CW17 DO17:DR17 for DA17:DW17 O18:O18 for A18:W18 AO18:AR18 for AA18:AW18 BO18:BR18 for BA18:BW18 CO18:CR18 for CA18:CW18 DO18:DR18 for DA18:DW18 O19:O19 for A19:W19 AO19:AR19 for AA19:AW19 BO19:BR19 for BA19:BW19 CO19:CR19 for CA19:CW19 DO19:DR19 for DA19:DW19 O20:O20 for A20:W20 AO20:AR20 for AA20:AW20 BO20:BR20 for BA20:BW20 CO20:CR20 for CA20:CW20 DO20:DR20 for DA20:DW20 O21:O21 for A21:W21 AO21:AR21 for AA21:AW21 BO21:BR21 for BA21:BW21 CO21:CR21 for CA21:CW21 DO21:DR21 for DA21:DW21 O22:O22 for A22:W22 AO22:AR22 for AA22:AW22 BO22:BR22 for BA22:BW22 CO22:CR22 for CA22:CW22 BO22:DR22 for DA22:DW22 O23:O23 for A23:W23 AO23:AR23 for AA23:AW23 BO23:BR23 for BA23:BW23 CO23:CR23 for CA23:CW23 DO23:DR23 for DA23:DW23 O24:O24 for A24:W24 AO24:AR24 for AA24:AW24 BO24:BR24 for BA24:BW24 CO24:CR24 for CA24:CW24 DO24:DR24 for DA24:DW24 O25:O25 for A25:W25 AO25:AR25 for AA25:AW25 BO25:BR25 for BA25:BW25 CO25:CR25 for CA25:CW25 DO25:DR25 for DA25:DW25 O26:O26 for A26:W26 AO26:AR26 for AA26:AW26 BO26:BR26 for BA26:BW26 CO26:CR26 for CA26:CW26 DO26:DR26 for DA26:DW26 ANY IDEA's Gary''s Student wrote: Try: Sub gsnu() Dim r1 As Range, r2 As Range Set r1 = Range("O4:R4") Set r2 = Range("A4:W4") If Application.CountA(r1) = 0 Then r2.Delete End If End Sub -- Gary's Student "VexedFist" wrote: Help I am writing a Macro in excel an have a problem. I need to check a Section of Cells for Values (O4:R4). If there is a Value continue. If NO Value then Delete Cells (A4:W4). I cannot delete the Whole Row because there is data in other cells (AA4:AW4). Cells X4, Y4 and Z4 are are open and unused. once complete I will use this to check other cells in this Row as well as other Rows. (A4:W4) (AA4:AW4) (BA4:BW4) (CA4:CW4) (DA4:DW4) Any help would be appreciated |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Macro
Sub CheckData()
Dim i As Long, j As Long For i = 26 To 2 Step - 1 For j = 15 To 119 Step 26 If Application.CountA(Cells(i, j).Resize(1, 4)) = 0 Then Cells(i, j).Offset(0, -14).Resize(1, 23).Delete Shift:=xlShiftUp End If Next Next End Sub -- Regards, Tom Ogilvy "VexedFist" wrote in message oups.com... Tom, I need to DELETE Cells A2:W2 If there is NO data in cells O2:R2 Range("A2:W2").Delete shift:=xlUp Any Ideas? Tom Ogilvy wrote: Sub CheckData() Dim i As Long, j As Long For i = 2 To 26 For j = 15 To 119 Step 26 If Application.CountA(Cells(i, j).Resize(1, 4)) = 0 Then Cells(i, j).Offset(0, -14).Resize(1, 23).ClearContents End If Next Next End Sub I assume by delete you just want to clear any values in those cells. -- Regards, Tom Ogilvy "VexedFist" wrote in message oups.com... Thank you, One follow-Up question. I also need to set thru the rows(2 thru 26) for each Range. Is there any way to simplify this a little more? Below are all of the Ranges and rows i need to step thru. O2:O2 for A2:W2 AO2:AR2 for AA2:AW2 BO2:BR2 for BA2:BW2 CO2:CR2 for CA2:CW2 DO2:DR2 for DA2:DW2 O3:O3 for A3:W3 AO3:AR3 for AA3:AW3 BO3:BR3 for BA3:BW3 CO3:CR3 for CA3:CW3 DO3:DR3 for DA3:DW3 O4:O4 for A4:W4 AO4:AR4 for AA4:AW4 BO4:BR4 for BA4:BW4 CO4:CR4 for CA4:CW4 DO4:DR4 for DA4:DW4 O5:O5 for A5:W5 AO5:AR5 for AA5:AW5 BO5:BR5 for BA5:BW5 CO5:CR5 for CA5:CW5 DO5:DR5 for DA5:DW5 O6:O6 for A6:W6 AO6:AR6 for AA6:AW6 BO6:BR6 for BA6:BW6 CO6:CR6 for CA6:CW6 DO6:DR6 for DA6:DW6 O7:O7 for A7:W7 AO7:AR7 for AA7:AW7 BO7:BR7 for BA7:BW7 CO7:CR7 for CA7:CW7 DO7:DR7 for DA7:DW7 O8:O8 for A8:W8 AO8:AR8 for AA8:AW8 BO8:BR8 for BA8:BW8 CO8:CR8 for CA8:CW8 DO8:DR8 for DA8:DW8 O9:O9 for A9:W9 AO9:AR9 for AA9:AW9 BO9:BR9 for BA9:BW9 CO9:CR9 for CA9:CW9 DO9:DR9 for DA9:DW9 O10:O10 for A10:W10 AO10:AR10 for AA10:AW10 BO10:BR10 for BA10:BW10 CO10:CR10 for CA10:CW10 DO10:DR10 for DA10:DW10 O11:O11 for A11:W11 AO11:AR11 for AA11:AW11 BO11:BR11 for BA11:BW11 CO11:CR11 for CA11:CW11 DO11:DR11 for DA11:DW11 O12:O12 for A12:W12 AO12:AR12 for AA12:AW12 BO12:BR12 for BA12:BW12 CO12:CR12 for CA12:CW12 BO12:DR12 for DA12:DW12 O13:O13 for A13:W13 AO13:AR13 for AA13:AW13 BO13:BR13 for BA13:BW13 CO13:CR13 for CA13:CW13 DO13:DR13 for DA13:DW13 O14:O14 for A14:W14 AO14:AR14 for AA14:AW14 BO14:BR14 for BA14:BW14 CO14:CR14 for CA14:CW14 DO14:DR14 for DA14:DW14 O15:O15 for A15:W15 AO15:AR15 for AA15:AW15 BO15:BR15 for BA15:BW15 CO15:CR15 for CA15:CW15 DO15:DR15 for DA15:DW15 O16:O16 for A16:W16 AO16:AR16 for AA16:AW16 BO16:BR16 for BA16:BW16 CO16:CR16 for CA16:CW16 DO16:DR16 for DA16:DW16 O17:O17 for A17:W17 AO17:AR17 for AA17:AW17 BO17:BR17 for BA17:BW17 CO17:CR17 for CA17:CW17 DO17:DR17 for DA17:DW17 O18:O18 for A18:W18 AO18:AR18 for AA18:AW18 BO18:BR18 for BA18:BW18 CO18:CR18 for CA18:CW18 DO18:DR18 for DA18:DW18 O19:O19 for A19:W19 AO19:AR19 for AA19:AW19 BO19:BR19 for BA19:BW19 CO19:CR19 for CA19:CW19 DO19:DR19 for DA19:DW19 O20:O20 for A20:W20 AO20:AR20 for AA20:AW20 BO20:BR20 for BA20:BW20 CO20:CR20 for CA20:CW20 DO20:DR20 for DA20:DW20 O21:O21 for A21:W21 AO21:AR21 for AA21:AW21 BO21:BR21 for BA21:BW21 CO21:CR21 for CA21:CW21 DO21:DR21 for DA21:DW21 O22:O22 for A22:W22 AO22:AR22 for AA22:AW22 BO22:BR22 for BA22:BW22 CO22:CR22 for CA22:CW22 BO22:DR22 for DA22:DW22 O23:O23 for A23:W23 AO23:AR23 for AA23:AW23 BO23:BR23 for BA23:BW23 CO23:CR23 for CA23:CW23 DO23:DR23 for DA23:DW23 O24:O24 for A24:W24 AO24:AR24 for AA24:AW24 BO24:BR24 for BA24:BW24 CO24:CR24 for CA24:CW24 DO24:DR24 for DA24:DW24 O25:O25 for A25:W25 AO25:AR25 for AA25:AW25 BO25:BR25 for BA25:BW25 CO25:CR25 for CA25:CW25 DO25:DR25 for DA25:DW25 O26:O26 for A26:W26 AO26:AR26 for AA26:AW26 BO26:BR26 for BA26:BW26 CO26:CR26 for CA26:CW26 DO26:DR26 for DA26:DW26 ANY IDEA's Gary''s Student wrote: Try: Sub gsnu() Dim r1 As Range, r2 As Range Set r1 = Range("O4:R4") Set r2 = Range("A4:W4") If Application.CountA(r1) = 0 Then r2.Delete End If End Sub -- Gary's Student "VexedFist" wrote: Help I am writing a Macro in excel an have a problem. I need to check a Section of Cells for Values (O4:R4). If there is a Value continue. If NO Value then Delete Cells (A4:W4). I cannot delete the Whole Row because there is data in other cells (AA4:AW4). Cells X4, Y4 and Z4 are are open and unused. once complete I will use this to check other cells in this Row as well as other Rows. (A4:W4) (AA4:AW4) (BA4:BW4) (CA4:CW4) (DA4:DW4) Any help would be appreciated |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
translate lotus 1-2-3 macro into excel macro using excel 2000 | Excel Programming |