+ Reply to Thread
Results 1 to 2 of 2

how to select row 1 to row with specific word, then shift column K of those rows by one

  1. #1
    Registered User
    Join Date
    07-02-2014
    Location
    Lebanon, NH
    MS-Off Ver
    Office 2013
    Posts
    2

    how to select row 1 to row with specific word, then shift column K of those rows by one

    Hey all,

    I'm hoping to create a script where I go from row 1 until I reach a row that contains a specific word in column B (in this case, a cell that begins with a comma). Then, I hope to shift column K of only the rows that I selected previously, to the right by one. How can I do this? I realize it requires the following steps.

    1. Do Until or for loop that contains an if statement that checks whether cells from column B/row i starts with the character comma. If not, move onto the cell in the next row (i = i+1). If it does start with a comma, then store that row value and then break from the loop.
    2. Highlight the cells from column k and row 1 through the row value stored from previous loop. Shift the cells by one to the right.

    *i'm especially having trouble with the basic syntax of highlighting the cells in column k and row 1 through the previously stored row value from step 1. How do I do this? it would also be helpful if I can hear about the previous steps too in #1.

    Thanks for your help.

  2. #2
    Forum Contributor
    Join Date
    03-12-2013
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2007
    Posts
    230

    Re: how to select row 1 to row with specific word, then shift column K of those rows by on

    Try this. Is there always going to be a cell in column B that starts with a comma though? If not, this will loop through every cell in column B.

    Please Login or Register  to view this content.

+ 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. Replies: 3
    Last Post: 06-22-2014, 06:21 AM
  2. [SOLVED] delete rows when column has specific word(s)
    By chrisblackman in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-22-2013, 10:21 PM
  3. [SOLVED] Using a macro to select rows with a specific word in a column
    By ahilty in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-15-2013, 04:20 PM
  4. Copy rows containing in column A specific word
    By Odeen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-15-2013, 10:24 AM
  5. [SOLVED] select rows to print where there's data in specific column
    By ebarbieri in forum Excel General
    Replies: 1
    Last Post: 07-04-2006, 07:00 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