Solved

Excel macro to shift columns

Posted on 2013-05-29
1
387 Views
Last Modified: 2013-08-22
Starting from row 1 in column D, I need to look at the values in column D.  If the value in the cell is not equal to "*",  then shift cells D and E to the right one column.
0
Comment
Question by:dbfromnewjersey
1 Comment
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 39204903
Try this.
Sub ShiftThings()
Dim I As Long

    For I = 1 To Range("D" & Rows.Count).End(xlUp).Row
        If Range("D" & I).Value <> "*" Then
           Range("D" & I).Insert xlShiftToRight
        End If
    Next I

End Sub

Open in new window

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question