Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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")


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=475452

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in
message ...

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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" wrote in message
...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is this wrong?


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)


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=475452

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is this wrong?


No replies, does this meens that there is nothing wrong with my code?


--
Ctech
------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=475452



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong? Max Excel Discussion (Misc queries) 0 February 5th 09 02:40 AM
What is wrong with my UDF jlclyde Excel Discussion (Misc queries) 4 October 24th 08 03:06 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
Am I doing something wrong here? TyeJae[_21_] Excel Programming 2 June 29th 04 12:56 AM
What's Wrong with This? D[_6_] Excel Programming 9 June 18th 04 05:50 PM


All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"