Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default if cell has null value, move data from one cell to another

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?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default if cell has null value, move data 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

"looped" wrote:

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?




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
Show a row of data in a different sheet if cell isn't null OCDinNC Excel Discussion (Misc queries) 6 December 23rd 08 01:51 PM
Cut some of the data in a cell and move to the neext cell bischofg Excel Discussion (Misc queries) 4 September 9th 08 11:00 PM
Move cell data to another worksheet cell automatically. Alan New Users to Excel 3 April 6th 08 08:05 PM
cell value based on null/not null in another cell spence Excel Worksheet Functions 1 February 18th 06 11:49 PM
cell shows 0 when referenced cell is null dee Excel Worksheet Functions 8 October 6th 05 01:39 PM


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