Correct front end of dynamic range

S

smandula

Could someone suggest an change in two variables

Private Sub CommandButton1_Click()
x = Range("AA1").Value
x2 = Range("AA2").Value
'Highlight_Duplicates (Sheets("Sheet1").Range("C2:V" & x))
Highlight_Duplicates (Sheets("Sheet1").Range("C" & x2:"V" & x))

End Sub

I need a front end solution for x2
Or another solution

x by itself works great for only one dimension.

With Thanks
 
J

JLGWhiz

I thing that if you would define your objective a little better, someone
could easily give you an answer. The code you postes is ambiguous.
 
S

smandula

I thing that if you would define your objective a little better, someone
could easily give you an answer.  The code you postes is ambiguous.

Sorry, A more detailed explanation:

I am trying to designate a range from AA1 which would be the end
range, as
'Highlight_Duplicates (Sheets("Sheet1").Range("C2:V" & x)) which
works for x

How to also change the start range "C2" with a variable AA2? for x2
I tried
Highlight_Duplicates (Sheets("Sheet1").Range("C" & x2:"V" & x))
This doen't work

It is the front end of C2 that I am looking for a solution.

I hope this explanation helps
 
S

smandula

Solution

Thanks to everyone who read this message

Private Sub CommandButton1_Click()

x = Range("AA1").Value
x2 = Range("AA2").Value

Highlight_Duplicates (Sheets("Sheet1").Range("C" & x2 & ":V" & x))

End Sub

'-------------------------------------

Just rearranged Quotes
 
J

JLGWhiz

Sorry I could not interpret what you were after. I now see that you wanted
to use the variable for the AA2 value as the row number for Column C. Guess
I never thought of it as front end before.
 
Top