Consulting

Results 1 to 5 of 5

Thread: Sleeper: SHIFT OR MOVE Cells On The Right...

  1. #1

    Sleeper: SHIFT OR MOVE Cells On The Right...

    My prob:

    SHIFT OR MOVE from the right all set of cells (T U V W) if i insert in the txtbox4 a new value...

    In effect during the data antry if i insert "2" in the txtbox4 shift or move from the right all set of cells (T U V W)

    In the wbook are present sheet ACTUALLY and AFTER
    Sal
    1 help 1 pizza
    2 help 1 pizza 1 caff?
    3 help 1 pizza 1 caff? 1 mozzarella
    ...
    Spaghetti, Lasagne and Tortellini for the "Lady" ;-)

  2. #2
    Hello,


    Put this code into the ACTUALLY sheet code window


    P
    rivate Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Column = 23 And Target.Row > 1 Then
        For MY_INSERT = 1 To Target.Value
            Range("T" & Target.Row).Insert (xlToRight)
        Next MY_INSERT
    End If
    End Sub


    I have assumed you want the data moved by the value entered.
    ---------------
    Hope this helps
    ---------------

    Have been away for a very long time,
    but am popping back again (now and then).

  3. #3
    WOW! But when i insert a new value in the column T the set of cells must move ALWAYS from 4 column not depent from the number inserted in T...
    Sal
    1 help 1 pizza
    2 help 1 pizza 1 caff?
    3 help 1 pizza 1 caff? 1 mozzarella
    ...
    Spaghetti, Lasagne and Tortellini for the "Lady" ;-)

  4. #4
    Hello,

    So what you are saying is that when you enter data in COL W you want the cells in T, U, V and W to moe to the right by four columns. But in your spreadsheet column T has mode to Column Y. Which is correct?

    This code moves it 5 over


    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Count > 1 Then Exit Sub
        If Target.Column = 23 And Target.Row > 1 Then
            Range("T" & Target.Row & ":X" & Target.Row).Insert (xlToRight)
        End If
    End Sub

    Change the X to W for four columns.
    ---------------
    Hope this helps
    ---------------

    Have been away for a very long time,
    but am popping back again (now and then).

  5. #5
    Hi, onlyadrafter tks for suggestion but i have many difficult to insert your code in my official wbook.

    The db in question are L0785_TOTALE and L0785_CDI_50

    Click on yellow button CERCA

    I would want to insert this code in column T of the related sheet L0785_TOTALE and L0785_CDI_50...

    yuo have undrstand correclly my prob and your macro work well...

    In effect when i insert a value in txtbox38 ESITO NOTE B.O.U. If in the column T is presente a number shift to left for 5 column and insert the new vlaue...

    My wbook is here

    http://www.gssitaly.com/l0785.zip
    Sal
    1 help 1 pizza
    2 help 1 pizza 1 caff?
    3 help 1 pizza 1 caff? 1 mozzarella
    ...
    Spaghetti, Lasagne and Tortellini for the "Lady" ;-)

Posting Permissions

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