ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I use values in two separate cells to select a new cell? (https://www.excelbanter.com/excel-programming/332355-how-can-i-use-values-two-separate-cells-select-new-cell.html)

nassetr

How can I use values in two separate cells to select a new cell?
 
I am using two user form list boxes to return values in two separate cells
(the cell link). I want one cell to correspond to a row, the other to a
column. I want a macro button that will automatically select the cell
corresponding with the values listed in the two cell links. Can anyone help?
Thanks.

Toppers

How can I use values in two separate cells to select a new cell?
 
Hi,

Is this what you want? This is for a button using the FORM toolbar
which calls macro "Button1_Click":

Sub Button1_Click()

Dim r as long, c as Integer

With Worksheets("Sheet1")
r = .Range("a1") ' Link cell for first listbox - row
c =. Range("b1") ' Link cell for second listbox - column
. Cells(r, c).Select
MsgBox ActiveCell
End with

End Sub


HTH

"nassetr" wrote:

I am using two user form list boxes to return values in two separate cells
(the cell link). I want one cell to correspond to a row, the other to a
column. I want a macro button that will automatically select the cell
corresponding with the values listed in the two cell links. Can anyone help?
Thanks.



All times are GMT +1. The time now is 03:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com