How can i incorporate the Range syntax into Cell syntax

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
688
Hello
How can i incorporate the Range syntax into Cell syntax
Code:
Private Sub CmbBooks_click()


Dim idx As Long
idx = CmbBooks.ListIndex
If idx <> -1 Then
  ws.Range("B" & idx +2 ).Value
End If
End sub
incorporating from above code into below seems not working
Code:
Dim idx As Long
idx = CmbBooks.ListIndex
 If idx <> -1 Then
         'ws.Cells(row, 2).value
          ws.Cells(idx +2 ,2).value
End If
Thanks NimishK
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
That code doesn't really make sense. What are you trying to do with the value of the cell?
 
Upvote 0
That code doesn't really make sense. What are you trying to do with the value of the cell?
thanks Rory if the syntax for cells code as mentioned does not make any sense then the matter ends.
I was trying to incorporate the cell syntax as mentioned in post #1 instead of range. Trying to click on the value listed in combobox with cell syntax if possible
 
Upvote 0
This
Code:
ws.Range("B" & idx +2 ).Value
is the same as
Code:
ws.Cells(idx +2 ,2).value
You just aren't doing anything with it.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top