VBA code:
PivotRange = Range("C" & myRows & ":" & endColumn)
Question:
Is this VBA code wrong to get the example below
i.e.
PivotRange = Range("C12343:D4")
VBA code:
PivotRange = Range("C" & myRows & ":" & endColumn)
Question:
Is this VBA code wrong to get the example below
i.e.
PivotRange = Range("C12343:D4")
No replies, does this meens that there is nothing wrong with my code?
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
>
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
>
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)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks