Ask Experts Questions for FREE Help !
Ask
    jakester's Avatar
    jakester Posts: 582, Reputation: 165
    Senior Member
     
    #1

    Apr 11, 2011, 11:49 AM
    Question about selecting Columns
    I'm stuck with a seemingly simple line of code in VBA.

    What I want to do in my spreadsheet is select Column C and all of the columns with data after it until I reach the final column of data (this is dynamic because the number of columns can vary). Then I want to offset 1 column and delete all of the columns I have selected.

    For example, let's say that I have columns going up to M with M being the last column. I want to select Column C and through L then, leaving Column M alone. The last column of my data set is a Grand Total column and I will always need it... all of the data in between I don't need so I want to just delete it.

    I tried something like Range("C:C", Selection.End(xlRight)).Select just to test whether it would work at all (minus the offset part) but it didn't.

    Any thoughts?

Check out some similar questions!

From 3 columns of data creating a 4th column with the most recent columns data [ 2 Answers ]

Hello, I was wondering if anyone can help with an excel query I have... I have 3 columns of information and want to summarise the most recent information in to a 4th column. i.e. the most up to date information. If the most recent column is blank use the information from the 2nd most recent...

Selecting device [ 1 Answers ]

I want to know how to select the device (MP4 Player) that I would like to sync my music that's saved on Media Windows. It says that the device is already downloaded to my computer.

2 Columns [ 15 Answers ]

Having a problem with 2 columns... for some reason it writes some of it in the first column, then the bit following in the second column, then goes back to the first column. I've tried switching to 1 column and back to 2 and the formatting stays that way. Help! :D:confused:


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.