I am working with a large sheet and I need to create a macro that looks to
see if there is a value in a cell Column G. If said cell is not null then I
need to have it delete the information in the corresponding cell in Column F.
I am a novice with excel and any help would be outstanding.
if Cells(YourRowNumberHere,"G").value <> "" then
'if you want to clear contents do this
Cells(YourRowNumberHere,"F").ClearContents
'if you want to delete it and shift data up do this
Cells(YourRowNumberHere,"F").Delete shift:=xlUp
end if
HTH
Die_Another_Day
ALoecher wrote:
> I am working with a large sheet and I need to create a macro that looks to
> see if there is a value in a cell Column G. If said cell is not null then I
> need to have it delete the information in the corresponding cell in Column F.
> I am a novice with excel and any help would be outstanding.
do the cells contain constant values. If they don't are they empty (the
cells you don't want to take action on).
Dim rng as Range
On Error Resume Next
set rng = columns("G").SpecialCells(xlConstants)
On Error goto 0
if not rng is Nothing then
set rng = Intersect(columns("F"),rng.EntireRow)
rng.ClearContents
End if
--
Regards,
Tom Ogilvy
"ALoecher" wrote:
> I am working with a large sheet and I need to create a macro that looks to
> see if there is a value in a cell Column G. If said cell is not null then I
> need to have it delete the information in the corresponding cell in Column F.
> I am a novice with excel and any help would be outstanding.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks