Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50273

[SOLVED] Referencing variable from another sheet

$
0
0
Hello,

I'm trying to figure out how to reference in a userform's code, the value of a range variable from Sheet1. I tried different approaches but this is out of my league.

I get the value from a cell on a table's column, upon double-clicking.

Code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim rng As Range
If Not Intersect(Target, Sheet1.ListObjects("ClientsTable").ListColumns("Destination").DataBodyRange) Is Nothing Then
    Cancel = True
    rng = Range(Target)
    UserForm1.Show
End If
End Sub

I need the userform to capture the target range and place the form's input in that specific cell.

Any suggestion?

Viewing all articles
Browse latest Browse all 50273

Latest Images

Trending Articles



Latest Images