Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro Question

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Macro Question

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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Macro Question

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.

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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Macro Question Vick Excel Discussion (Misc queries) 1 November 21st 07 06:28 PM
question about the macro vb some one help? nader Excel Programming 3 July 31st 04 01:35 AM
MACRO QUESTION dkcipoh Excel Programming 2 October 28th 03 05:36 AM
macro question foamfollower Excel Programming 2 September 20th 03 02:04 AM


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