Mar 03 2023 02:35 AM - edited Mar 03 2023 02:36 AM
Hi All,
I am using below code to get column data from another worksheet, but the below code is working for full column, and I don't want to replace my Heder data of another sheet.
can someone help me with the rectification in code.
Sub Select_Data()
Dim lr As Long
lr = Sheet1.Range("B" & Rows.Count).End(xlUp).Row
If Not IsEmpty(Sheet1.Range("B1:B" & lr).Value) Then Sheet2.Range("B1:B" & lr).Value = Sheet1.Range("B1:B" & lr).Value
End Sub
Mar 03 2023 03:10 AM
Mar 03 2023 03:17 AM
Mar 03 2023 03:23 AM
SolutionMar 03 2023 03:42 AM - edited Mar 03 2023 03:43 AM
Hi @FikturFox
It is working fine, I have done small change insted of +7 it is woking with +6.
Sub Select_Data()
Dim lr As Long
lr = Sheet1.Range("B" & Rows.Count).End(xlUp).Row
If Not IsEmpty(Sheet1.Range("B2:B" & lr).Value) Then Sheet2.Range("B8:B" & lr+6).Value = Sheet1.Range("B2:B" & lr).Value
End Sub
Mar 03 2023 03:23 AM
Solution