안녕하세요, 열을 통해 0보다 큰 값을 확인하는 코드가 있습니다. 해당 열을 시트에 복사하여 붙여 넣으면 팝업 메시지가 표시됩니다.
코드를 시도했지만 정의 할 수 없으므로 a
도움이 필요합니다. 감사합니다 :)
다음은 코드입니다.
Option Explicit
Sub TestPasteColumnData2()
Dim lastrow As Long
Dim i As Long
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
For i = 4 To lastrow
a = Cells(i, "C").Value
If a < 0 Then
MsgBox ("No Value")
Exit Sub
Else
Sheets("WF - L12 (3)").Columns(3).Copy Destination:=Sheets("Sheet1").Columns(3)
End If
Next
MsgBox ("Done")
End Sub
Sub TestPasteColumnData3()
Dim lastcol As Long
Dim j As Long
With Worksheets("WF - L12 (3)")
lastcol = .Cells(4, Columns.Count).End(xlToLeft).Column
For j = 3 To lastcol
If CBool(Application.CountIfs(.Columns(j), ">0")) Then
.Columns(j).Copy Destination:=Worksheets("Sheet1").Columns(3)
Else
MsgBox ("No Value")
Exit Sub
End If
Next
End With
MsgBox ("Done")
End Sub
... 열을 통해> 0 값이 있는지 확인하는 경우 해당 열을 시트 1에 붙여 넣습니다.
Sub TestPasteColumnData2()
With Worksheets("WF - L12 (3)")
If CBool(Application.CountIfs(.Columns(3), ">0")) Then
.Columns(3).Copy Destination:=Worksheets("Sheet1").Columns(3)
Else
MsgBox ("No Value")
Exit Sub
End If
End With
MsgBox ("Done")
End Sub
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다