Hi Guys ,
I need to know and fix problem copy data from userform .
it should start from row2 when copy data but it will replace for some headers in row 1 when select optionbuttons and fill textboxes .
thanks
Hi Guys ,
I need to know and fix problem copy data from userform .
it should start from row2 when copy data but it will replace for some headers in row 1 when select optionbuttons and fill textboxes .
thanks
Hi Alaa
The problem is that you forgot to define variable lr (last row). Do this just after the opening With statement:
With ws
lr = .Range("A" & Rows.Count).End(xlUp).Row
Notice that I didn't say lr=ws.Range... (since the With means you don't have to).
If you want to declare the variable, use Dim lr as Long