Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Clear Data and Delete Column

Posted on 2011-02-25
2
Medium Priority
?
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

636 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