snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Public Sub pullmonth1()
Dim i As Integer, x As Integer
Dim month() As String
Dim comparecommit() As Integer
Dim no_c As Single, no_d As Single, sum As Single, total As Single
i = 1
no_d = 0
Do Until Worksheets("MONTH").Cells(i + 1, 1).Value = ""
i = i + 1
no_d = no_d + 1
Loop
ReDim month(1 To no_d)
i = 1
For i = 1 To no_d ' collection with array sheet : MPS COMPARE
month(i) = Worksheets("MONTH").Cells(1 + i, 1).Value
Next i
i = 1
For i = 1 To no_d
ActiveWorkbook.Sheets("MPS COMPARE").Activate
If Worksheets("MPS COMPARE").Cells(6, 2 + i).Value = "" Then
Worksheets("MPS COMPARE").Cells(6, 2 + i).Value = Worksheets("MONTH").Cells(1 + i, 1).Value
End If
Next i
End Sub
comparemps.xlsm
You do not have the required permissions to view the files attached to this post.