+ Reply to Thread
Results 1 to 3 of 3

Can I use a variable in a Range statement

  1. #1
    Registered User
    Join Date
    05-11-2006
    Posts
    11

    Can I use a variable in a Range statement

    I have tried to use a variable in this Range satement but I get a Select Method of Range Class Failed. I need to reformat this as I move data.
    X is a changing row variable.
    Any help would be greatly appreciated
    Thanks
    Bill
    Dim Temp as String
    Temp = "O" & X

    If TopInches < 10 Then
    Range(Temp).Select
    Selection.NumberFormat = "## ""' "" 0 ##/##"
    Else
    Range(Temp).Select
    Selection.NumberFormat = "## ""' "" #0 ##/##"
    End If

  2. #2
    Forum Contributor
    Join Date
    06-10-2005
    Location
    Central Jersey
    Posts
    117
    You mean something like this?

    Please Login or Register  to view this content.
    -Joseph

  3. #3
    Registered User
    Join Date
    05-11-2006
    Posts
    11

    Range formating

    Thanks that worked

    any thoughts on the formating if TopInches is >10 then I was going to format using this:Range(Temp).NumberFormat = "## ""' "" #0 ##/##"

    But I get the wrong result 161' 03/4
    It shold be 16' 10 3/4

    Thanks bill

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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