Solved

VBA - EXCEL CHALLENGING QUESTION!!

Posted on 2004-09-27
3
280 Views
Last Modified: 2010-04-17
I need help to write a vba script to search down one column for rows that starts with "GR" within the cell.  Some of the rows could be blank so the search can not end upon reaching the first blank cell.  Once the search finds a cell starting with "GR" the cell containing GR and the 3 cells on the right of this cell must be moved to (offset) to the same row but to column AA.
Note that I must be able to run this for many columns (not only one), but all of the results irrrespective of where the GR cell  is (that is at which column that is), must conclude in column AA

Thanks in advance.
0
Comment
Question by:fzd
3 Comments
 
LVL 11

Accepted Solution

by:
Louis01 earned 125 total points
ID: 12166892
   Dim i As Long
    Dim ws As Worksheet
   
    Set ws = Worksheets("Sheet1")
   
    For i = 1 To ws.UsedRange.Rows.Count
        If Left(ws.Cells(i, 1), 2) = "GR" Then
            ws.Range(ws.Cells(i, 1), Sheet1.Cells(i, 4)).Cut Destination:=Sheet1.Cells(i, 27)
        End If
    Next i
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
A short article about a problem I had getting the GPS LocationListener working.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

914 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now