+ Reply to Thread
Results 1 to 5 of 5

Is this wrong?

  1. #1
    Forum Contributor
    Join Date
    10-03-2005
    Posts
    183

    Is this wrong?

    VBA code:

    PivotRange = Range("C" & myRows & ":" & endColumn)

    Question:

    Is this VBA code wrong to get the example below


    i.e.

    PivotRange = Range("C12343:D4")

  2. #2
    Forum Contributor
    Join Date
    10-03-2005
    Posts
    183
    No replies, does this meens that there is nothing wrong with my code?

  3. #3
    Tom Ogilvy
    Guest

    Re: Is this wrong?

    depends on what is in your variables

    MyRows = 132343
    EndColumn = "D4"

    would provide what you show.

    if endcolumn = 4 then

    PivotRange = Range("C" & myRows & ":D" & endColumn)

    --
    Regards,
    Tom Ogilvy


    "Ctech" <[email protected]> wrote in
    message news:[email protected]...
    >
    > VBA CODE:
    >
    > PivotRange = Range("C" & myRows & ":" & endColumn)
    >
    > QUESTION:
    >
    > Is this VBA code wrong to get the example below
    >
    >
    > *i.e. *
    >
    > PivotRange = Range("C12343:D4")
    >
    >
    > --
    > Ctech
    > ------------------------------------------------------------------------
    > Ctech's Profile:

    http://www.excelforum.com/member.php...o&userid=27745
    > View this thread: http://www.excelforum.com/showthread...hreadid=475452
    >




  4. #4
    Ron de Bruin
    Guest

    Re: Is this wrong?

    Hi Ctech

    Try it like this

    Sub test()
    Dim PivotRange As Range
    Dim myRows As Long
    Dim endColumn As Integer
    myRows = 12
    endColumn = 4
    Set PivotRange = Range(Cells(myRows, "C"), Cells(4, endColumn))
    PivotRange.Select
    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Ctech" <[email protected]> wrote in message
    news:[email protected]...
    >
    > VBA CODE:
    >
    > PivotRange = Range("C" & myRows & ":" & endColumn)
    >
    > QUESTION:
    >
    > Is this VBA code wrong to get the example below
    >
    >
    > *i.e. *
    >
    > PivotRange = Range("C12343:D4")
    >
    >
    > --
    > Ctech
    > ------------------------------------------------------------------------
    > Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
    > View this thread: http://www.excelforum.com/showthread...hreadid=475452
    >




  5. #5
    Forum Contributor
    Join Date
    10-03-2005
    Posts
    183
    How can i make

    myColumn = cell.column
    i.e
    myColumn = D

    So far I have managed to get D5 or just (4, which I guess is D in number form)

+ 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