View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default If then statement

This macro has the IF statements that you requi


Sub spackle()
Dim r As Range, nLastRow As Long
Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1
For l = 1 To nLastRow
If IsEmpty(Cells(l, 7).Value) Then
If Not IsEmpty(Cells(l, 11).Value) Then
Cells(l, 7).Value = Cells(l, 11).Value
End If
End If
Next
End Sub
--
Gary's Student


"SITCFanTN" wrote:

I'm new to using if then statements, but I think that is what I need to
accomplish this task. Here is my situation. I download a report everyday
that has thousands of rows and the row count changes each day. In an
unknown number of rows, column G is empty and the data I need to move into
Column G is in Column K. So I guess what I need is something that would say
If in any row G is empty and if there is data in that row in column K, move
that data in column K to column G. Is this even possible? Thanks so much.
I plan on putting this code in Macro1 with my page setup code. Thank you