Closed Thread
Results 1 to 2 of 2

Applying function to Range

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-13-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    217

    Applying function to Range

    Hello, I want to apply this function to a range that I do not have to individually highlight on individual sheets. Can someone edit my code to make the range be columns W:AF but only going down to the last row in which there is data? So you could check column A for instance, to see if there is data. And the last row that column A has data, the last row the function will go through on W:AF. I would also like it to work over every worksheet.

    Function GetCells(MyRange As Range)
    Dim Cell As Range
    For Each Cell In MyRange
        If Cell <> "" Then
            GetCells = GetCells & Cell.Value & " "
        End If
    Next Cell
    If GetCells <> "" Then GetCells = Left(GetCells, Len(GetCells) - 1)
    End Function
    Sub Concatenate()
    
    End Sub

    I think I could use something like

    LR = Cells(Rows.Count, "A").End(xlUp).Row
    set MyRange=("W1:AF" & LR)
    but I am not sure because everything I have tried is not working.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Applying function to Range

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread. http://www.excelforum.com/excel-prog...to-ranges.html

    Thread Closed.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

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