Solved

Clear Data and Delete Column

Posted on 2011-02-25
2
207 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 500 total points
Comment Utility
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
Comment Utility
Hi,

Thanks a lot for the help.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

771 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

11 Experts available now in Live!

Get 1:1 Help Now