?
Solved

Clear Data and Delete Column

Posted on 2011-02-25
2
Medium Priority
?
217 Views
Last Modified: 2012-08-13
Hi Experts,

I would like to request Experts help create a macro to clear all data and delete column starts with  “Status” as a header at “Validation2” sheet. I have attached the workbook for Experts perusal. Hope Experts will help me to create this function.



DeleteData.xls
0
Comment
Question by:Cartillo
2 Comments
 
LVL 24

Accepted Solution

by:
StephenJR earned 2000 total points
ID: 34978427
If I understand correctly...
Sub x()
  
Dim rFind As Range
 
With Sheets("Validation2")
    .Range("A1").CurrentRegion.Offset(1).ClearContents
    Set rFind = .Rows(1).Find(What:="Status", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
    If Not rFind Is Nothing Then
        Do
            rFind.EntireColumn.Delete shift:=xlToLeft
            Set rFind = .Rows(1).Find(What:="Status", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
        Loop Until rFind Is Nothing
    End If
End With
     
End Sub

Open in new window

0
 

Author Closing Comment

by:Cartillo
ID: 34985657
Hi,

Thanks a lot for the help.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

850 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