Consulting

Results 1 to 3 of 3

Thread: How to move column of data down (shift it by 1 row)

  1. #1
    VBAX Regular
    Joined
    Dec 2021
    Posts
    58
    Location

    How to move column of data down (shift it by 1 row)

    I have created two tables by macro. Column A and B is reserved for table 1. C is empty. D will contain IDs from 1 up... but now it is empty. In column E I have strings of districts. Headers are in first row. Now I need to add to the columns D, E values 0 and "not selected". So I need to move the data column E down. So question is:
    How to move data in range E2:E15 to E3:E16?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    In VBA?

    Range("E2:E15").Cut Destination:=Range("E3:E16")
    or if you want to be a bit more flexible

    Dim rng As Range
    
        Set rng = Range("E2:E15")
        rng.Cut Destination:=rng.Offset(1)
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Dec 2021
    Posts
    58
    Location
    Thank you

Posting Permissions

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