เรียน ท่ายผู้รู้
ถาม1
เกี่ยวกับ code ตัวนี้กรณีที่ต้องการให้ excel เลื่อนลงไปหา cell ล่างสุดที่มีอักษรที่ละ 1 step
อย่างไฟล์แนบที่ C15 (step1)
อย่างไฟล์แนบที่ C22 (step2)
ใช้ code ซ้ำไม่ได้ VBA จะขยาย range เพิ่มไปยัง C15,C22 ช่วยแนะนำ code ด้วยครับ
ถาม2
Code นี้ไม่แสดงสูตร date ใน excel sheet
[d2].Formula = "DATE(C2,B2,A2)" 'not calcucate
[c2].Select
Range(Selection, Selection.End(xlDown)).Select 'cannot go down cross blank cell to next usedrange
code เพิ่ม
Code: Select all
Sub ad()
For b = 1 To Sheets.Count
Sheets(b).Select
Sheets(b).Name = b
If [d1] = "order date" Then Exit Sub
[d:d].Insert
[d1].Value = "order date"
[d2].Formula = "DATE(C2,B2,A2)" 'not calcucate
[d2].Columns.AutoFit
[c2].Select
Range(Selection, Selection.End(xlDown)).Select 'cannot go down cross blank cell to next usedrange
Selection.Offset(0, 1).Select
Selection.FillDown
Next b
End Sub
code ลบ
Code: Select all
Sub del()
For b = 1 To Sheets.Count
Sheets(b).Select
Sheets(b).Name = b
If [d1] = "order date" Then [d:d].Delete
Next b
End Sub