LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Range selection

Hi the

I have big confusion because of range problem in vba.

I'll explain : first, i select one column and want to divide into k
columns.
let r=selection. range "numb" have the data how many cells in one
column.

For example, if numb.cells(1,1) = 2, then first column have two cells.
like following
numb r
========================
2 1~2
3 3~5
1 6
4 7~10


Thus, bgn_num, end_num is the start and ending point.
Therefore code is following, Before doing real job, i want to check
that dividing column works well. However, unfortunately, it doesn't
work. I cannot find any problem.
I can use "c.Cells.Count". Moreover the result is right. However, other
functions, like sum, min, max doesn't work.(Those are my real aim)



k=numb.Cells.Count
end_numb = 1
bng_numb = 1


For i = 1 To k

end_num = end_num + numb.Cells(i, 1)

Set c = r.Cells.Range(r.Cells(bgn_num, 1), r.Cells(end_num, 1))

temp1 = c.Cells(1, 1)


Cells(9 + i, 9).Select
ActiveCell.FormulaR1C1 = temp1


bgn_num = bgn_num + numb.Cells(i, 1)

Next




I guess c.Cells(1,1) doesn't work well. If I use c.Cells(1,1).Value,
also not working.
Please help me. Thx alot.

 
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
Narrow Range based on Selection in Another Range David Excel Discussion (Misc queries) 3 July 1st 07 05:12 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Range Selection stu Excel Programming 1 July 10th 04 02:28 PM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM
Creating range name for a range selection Mervyn Thomas Excel Programming 1 January 26th 04 05:18 PM


All times are GMT +1. The time now is 01:46 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"