I have wrote a code which is working fine but it copies the whole column rather than used range.
Can someone please help me in this regard. I have tried it using lastrow but do not know how to do this and please also share that if i want to add more column then how it would be done.
or is there better way to do this please share.
Your help means a lot to me.
lastrow = totalWS.Cells(totalWS.Rows.Count, 1).End(xlUp).Row
Sheet1.Columns(1).Copy
Sheet3.Columns(1).PasteSpecial xlPasteValues
Sheet1.Columns(2).Copy
Sheet3.Columns(2).PasteSpecial xlPasteValues
Sheet1.Columns(4).Copy
Sheet3.Columns(4).PasteSpecial xlPasteValues
Sheet1.Columns(5).Copy
Sheet3.Columns(5).PasteSpecial xlPasteValues
Sheet1.Columns(6).Copy
Sheet3.Columns(6).PasteSpecial xlPasteValues
Sheet1.Columns(7).Copy
Sheet3.Columns(7).PasteSpecial xlPasteValues
End Sub