Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to select "last used column + 1"
Hello,
Is there a simple macro to select column C till the last one + 1 column extra. For example.... I used column C till K, so... I want to select C till L (one more than the last one used). regards, Johan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to select "last used column + 1"
you don't say how many rows are involved, so this just selects row 1. maybe you
can adapt it. i just use select here as an example. Sub test() Dim ws As Worksheet Dim lastcol As Long Set ws = Worksheets("Sheet1") lastcol = ws.Cells(1, Columns.Count).End(xlToLeft).Column + 1 ws.Range(ws.Cells(1, 3), ws.Cells(1, lastcol)).Select End Sub -- Gary "johan" wrote in message ps.com... Hello, Is there a simple macro to select column C till the last one + 1 column extra. For example.... I used column C till K, so... I want to select C till L (one more than the last one used). regards, Johan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i select a column when using "exact" formula? | Excel Discussion (Misc queries) | |||
How to select a single "column" of a VBA array? | Excel Programming | |||
"Control" plus "click" doesn't allow me to select multiple cells | New Users to Excel | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming | |||
"Select Column method or property not available because some/all of object doesn't refer to table" | Excel Programming |