+ Reply to Thread
Results 1 to 3 of 3

Set column name as a variable to be used in range

  1. #1
    Registered User
    Join Date
    04-18-2023
    Location
    singapore
    MS-Off Ver
    2022
    Posts
    2

    Exclamation Set column name as a variable to be used in range

    Basically im trying to set a name for my column which will be used in the "Range" but i couldnt seems to do it. Anyone knows why??




    Dim lastcol As String
    lastcol = "P"

    If z = "" Then
    Sheets("B").Range("J:lastcol").EntireColumn.Hidden = True
    End If

  2. #2
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: Set column name as a variable to be used in range

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-18-2023
    Location
    singapore
    MS-Off Ver
    2022
    Posts
    2

    Re: Set column name as a variable to be used in range

    It worked thankssss!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Get Last column in range stored as variable
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2017, 03:00 AM
  2. Summing Variable Range in a Column from Below
    By Fr33agent in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2013, 01:19 PM
  3. [SOLVED] Syntax for Using Range with a Variable Column
    By Gard5096 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-31-2013, 12:36 PM
  4. Variable range SUM , base range on other column blank cells?
    By stevnb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-20-2012, 10:55 AM
  5. Referencing column as a variable using Range?
    By MikeSD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2012, 07:22 PM
  6. Using last column value as variable within a range
    By Apel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2009, 12:58 PM
  7. [SOLVED] copy a range with known start column to variable end column
    By Matilda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2006, 12:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1