Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Dec 2003
    Location
    Perth, Western Australia, Australia
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cuting a cell value (2003)

    Loungers - I'm try to develop a formula which takes the value in a cell and moves it (ie cuts it rather than copies it).
    for example I have three columns A B & C. So if a value in a cell in say C1 = 1 cut the value in A1 and paste it in B1.

    I hope that makes sense - so the formula performs a cut and paste rather than a copy and pastes that an =A1 in C1 would give.

    Any thoughts?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cuting a cell value (2003)

    Formulas cannot perform actions on other cells. So a formula in a cell cannot cut the value of onother cell. Think of the consequences if it were possible:
    - The formula cuts the value of A1 and pastes it in B1. A1 is now blank.
    - You do something that causes Excel to recalculate. A1 is cut again, and pasted in B1. So now B1 is blank, and the original value of A1 is lost forever.

    You can cut and paste manually, or you can create a macro to do it, but not a formula.

  3. #3
    2 Star Lounger
    Join Date
    Dec 2003
    Location
    Perth, Western Australia, Australia
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cuting a cell value (2003)

    Thanks for the reply Hans, Sorry about not responding earler.

    Could you give me an example of what a macro would look like that would take the value in on cell A1 and move it to C1 based on a value in B1

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cuting a cell value (2003)

    Sub MoveCell()
    If Range("B1") = 1 Then
    Range("A1").Cut Destination:=Range("C1")
    End If
    End Sub

    You can run this macro by selecting Tools | Macro | Macros..., or you can assign it to a custom toolbar button or keyboard shortcut.

  5. #5
    2 Star Lounger
    Join Date
    Dec 2003
    Location
    Perth, Western Australia, Australia
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cuting a cell value (2003)

    Thanks again Hans - will give it a go

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •