View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Valeriy[_2_] Valeriy[_2_] is offline
external usenet poster
 
Posts: 1
Default Help to get values from 3 option button in one cell


One cell on the sheet from wich I am going to read information has 3
grouped
option buttons. To reach it I sequencially do
1) opening the file and puting it to variable
2) looping trough the file worksheets
3) asigning every file sheet and current worksheet to the local
variables
4) looping trough the rows on every file worksheet
5) asigning values from specific file worksheet cell to the currrent
sheet cell

File sheet and current sheet are structurally identical. I can read
value from all
file sheet cells exept those which have three grouped option button on
them (in
code fragment below this is cell E8). I opened it using cell
collection, Range
object but result is negative in both cases. I cannot see controls in
this cell

Set Wbk = Workbooks.Open(Filename:=TextBox1.Text)
For i = 1 To Wbk.Worksheets.Count
If i = 1 Then
Set S1 = ThisWorkbook.Sheets(1)
Set Wst = Wbk.Worksheets(1)
For j = 1 To S1.Rows.Count
Select Case j
Case 5
S1.Cells("5", "B").Value =
Wst.Cells("5", "B").Value

Case 7
S1.Cells("7", "B").Value =
Wst.Cells("7", "B").Value
Case 8
S1.Cells("8", "B").Value =
Wst.Cells("8", "B").Value
S1.Cells("8", "E") =
Wst.Cells("8", "E")
Set R1 =
ThisWorkbook.Worksheets(1).Range("E8")
Set R2 =
Wbk.Sheets(1).Range("E8")
End Select
Next j
...........
Do You know why?


--
Valeriy
------------------------------------------------------------------------
Valeriy's Profile: http://www.excelforum.com/member.php...o&userid=25245
View this thread: http://www.excelforum.com/showthread...hreadid=387372