Rabu, 13 April 2016

[ExcelVBA] select range


I want to Select a range based on a named range "test"  (that may change).

My New selected range are to consist of the named range, but not the first two columns.

This is my try:

Sub test2()
rader = Range("test").Rows.Count
kolonner = Range("test").Columns.Count

With Range("test")
    .Cells(.Cells(1, 3), .Cells(rader, kolonner)).Select
End With

The result is one cell selected - the one that is one up and one left from the range's upper left corner.




Posted by: Torstein Johnsen <sejohnse@yahoo.no>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

Visit our ExcelVBA group home page for more info and support files:

More free tutorials and resources available at:




Tidak ada komentar:

Posting Komentar