abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,429
- Office Version
- 2019
- 2010
- Platform
- Windows
hello
i have this code works before i add condition to prevent copy the same data again based on column a in sheet report when i copy from sheet beginning
i would appriciate if anybody help
i have this code works before i add condition to prevent copy the same data again based on column a in sheet report when i copy from sheet beginning
i would appriciate if anybody help
VBA Code:
Sub posting()
Dim lr As Integer
Dim wsh As Worksheet
Set wsh = Sheets("report")
lr = Range("b" & Rows.Count).End(xlUp).Row
If wsh.Cells(lr, 1).Value Then
MsgBox "you can't add this name"
wsh.Rows(lr).Clear
Else
wsh.Range("a" & lr + 1) = Sheets("begining").Range("b6").Value
wsh.Range("b" & lr + 1) = Sheets("begining").Range("b7").Value
End If
End Sub