Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Question about selecting Columns (https://www.askmehelpdesk.com/showthread.php?t=569585)

  • Apr 11, 2011, 11:49 AM
    jakester
    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?

  • All times are GMT -7. The time now is 02:19 AM.