Solved

Clear column

Posted on 2011-02-11
9
256 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

773 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