if cell has null value, move data from one cell to another

  • Thread starter Thread starter looped
  • Start date Start date
L

looped

I have Owner1, Owner2, Owner3, OwnerAddress

I want to query Owner3 and IF null (blank), move value of Owner2 to
OwnerAddress.

Is this enough info to give me a push in the right direction? I
understand functions can't move data? So I need to use some code
like:

Sub MyMacro1()
'
' MyMacro1 Macro
'

'
Range("I3").Select
Selection.Cut
Range("K3").Select
ActiveSheet.Paste
End Sub


Can someone help with a routine to look for null and if so execute
some code to move (cut and paste) values from one cell to another?
 
Something like this?

Sub CopyAddress()
Dim rng As Range
Dim wks As Worksheet

Set wks = ActiveSheet
Set rng = wks.Range("K65535").End(xlUp)

Do While rng.Row > 1
If rng.Offset(0, -1).Value = Empty Then
rng.Value = rng.Offset(0, -2).Value
rng.Offset(0, -2).Value = Empty
End If
Set rng = rng.Offset(-1, 0)
Loop
End Sub

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top