+ Reply to Thread
Results 1 to 10 of 10

Offset to move content with inputbox

  1. #1
    Forum Contributor
    Join Date
    10-09-2018
    Location
    Quebec, Canada
    MS-Off Ver
    Office 365
    Posts
    125

    Offset to move content with inputbox

    Hello Forum,

    I work with a VBA code intended to move the content of each cell with bold font in a given range (column), to the previous column, same row:

    Please Login or Register  to view this content.
    First, I would like users to enter the column number rather than select a range with the Type 8 inputbox since mistakes may occur (users select 2 columns at a time for example). The last row would be the 5000th.

    Second, I would like users to enter the column to which the content should be moved. I can't figure how to do this since Offset doesn't work with a column number.

    Unfortunately, my knowledge of the VBA mysteries doesn't go that far...

    Can anyone help me?

    Thank you so much in advance.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Offset to move content with inputbox

    Will the range selection always start in row 2? Will the last row always be 5000 or does it vary?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Offset to move content with inputbox

    How about
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    10-09-2018
    Location
    Quebec, Canada
    MS-Off Ver
    Office 365
    Posts
    125

    Re: Offset to move content with inputbox

    Hello Mumps1,

    I was assuming from row 2 to 5000. But if you can throw an inputbox for them as well, then I'm in

    Thank you.

  5. #5
    Forum Contributor
    Join Date
    10-09-2018
    Location
    Quebec, Canada
    MS-Off Ver
    Office 365
    Posts
    125

    Re: Offset to move content with inputbox

    Hello Fluff,

    The End column being ... the one with the content to move?

    I tried several options but nothing happens.

    Thank you too anyway for your time.

    Edit: yessss.... I finally opened my eyes. It works!
    Last edited by Sybille; 01-21-2019 at 03:18 PM.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Offset to move content with inputbox

    Start column is the column you want to move & end column is where you want to place it.
    So if the data is in col H & you want to move it 1 column left (ie G) you would use 8 and then 7

  7. #7
    Forum Contributor
    Join Date
    10-09-2018
    Location
    Quebec, Canada
    MS-Off Ver
    Office 365
    Posts
    125

    Re: Offset to move content with inputbox

    Thank you so much Fluff. I change the status to "Solved" but keep an eye on it just in case Mumps shows up with another option.

    Thank you very much to both of you.

    Edit :

    I was able to add the first row variable, just in case somebody needed it:

    Please Login or Register  to view this content.
    Last edited by Sybille; 01-21-2019 at 03:37 PM.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Offset to move content with inputbox

    You're welcome & thanks for the feedback.

    If the column will not always have 5000 rows you can use
    Please Login or Register  to view this content.

  9. #9
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Offset to move content with inputbox

    Here, I just used one inputbox.
    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 01-21-2019 at 03:52 PM.

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Offset to move content with inputbox

    It looks like you received a lot of help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. HELP PLS! How to erase the content of an InputBox without For Each
    By fefo32br in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2018, 10:42 AM
  2. Replies: 3
    Last Post: 09-23-2015, 02:30 PM
  3. [SOLVED] Use Inputbox to find then select an offset range and print for ALL sheets
    By FuzzyDove in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-23-2015, 02:38 PM
  4. [SOLVED] How to set a restriction for the content input in Inputbox
    By qzqzjcjp in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-15-2014, 08:27 PM
  5. Offset Cell content VBA
    By DaveMurray23 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-09-2014, 10:31 AM
  6. Offset Inputbox function - change cell colour
    By TheLeafs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2011, 08:13 AM
  7. Replies: 2
    Last Post: 12-19-2006, 10:50 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1