Solved

Clear column

Posted on 2011-02-11
9
258 Views
Last Modified: 2012-05-11
Hello Experts,

Can someone please let me know if there are quick ways clear the contents within a column.

Basically, I'm constantly deleting/clearing the contents in a column and inserting new data from a new sheet.

So for example, in the attached spreadsheet I would clear all the symbols in column A sheet 1 and then go to sheet 2 copy the stock symbols in one of the columns and paste it into column A in sheet 1. I continue doing this until I've gone through all the symbols in sheet 2.

As you can imagine this can become quite a laborious task.

If you can help that would be greatly appreciate.

Thanks in advance.

Cheers

Carlton
delete-column.xlsx
0
Comment
Question by:cpatte7372
[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
  • 4
  • 3
9 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34870551
Select A2, press Ctrl+Shift+down arrow, then delete?
0
 

Author Comment

by:cpatte7372
ID: 34870721
Rory,

Thanks responding. I know my request makes me sound a little lazy but I was wondering if may be a macro could fulfill my request?
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 34870857
Sure:
Sub ClearColA()
   With Sheets("Sheet1")
      .Range("A2", .cells(.rows.count, "A").end(xlup)).ClearContents
   End With
End sub

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:cpatte7372
ID: 34870904
Rory,

Thanks again mate for responding.

I'm very new to excel programming. Can you please tell me how to add your code to excel?

Cheers

Carlton
0
 

Author Comment

by:cpatte7372
ID: 34871173
Rory,

I just need to know how to insert the formula/commands you specified.

Cheers
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34871181
1. Press Alt+f11 to open the Visual Basic Editor.
2. Locate your workbook in the Project Explorer window (top left usually), right-click it and choose Insert-Module.
3. Paste the code above into the blank code window that appears.
4. Save your file as a macro-enabled workbook (xlsm extension rather than xlsx)

You can then run the macro by pressing Alt+f8 to bring up the macros dialog box. In that dialog, you can also select the macro name from the list, click the Options... button and assign a shortcut key combination (such as Ctrl+Q) so that you can run it more easily.
0
 

Author Comment

by:cpatte7372
ID: 34872934
Rory,

That worked a treat.

Cheers mate.
0
 
LVL 24

Expert Comment

by:broomee9
ID: 35221176
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

740 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