[VBA] 蘇巧巧's Question
Option Explicit
Sub main()
Dim cell As Range
With Worksheets("1")
.Activate
.Range("A3").Activate
End With
Do While Len(ActiveCell.Value) > 0
With Worksheets("2")
Worksheets("template").Range("A1:J4").Copy .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
Worksheets("1").Range(ActiveCell, ActiveCell.Offset(0, 9)).Copy .Cells(.Rows.Count, 1).End(xlUp).Offset(-1, 0)
ActiveCell.Offset(1, 0).Activate
End With
Loop
With Worksheets("2")
.Columns(1).Cells.Replace what:="dummyValues", replacement:="", lookat:=xlWhole
.Activate
End With
MsgBox ("Data is imported into Sheet [2] now")
End Sub
Sub clearWorksheets()
With Worksheets("2")
.Cells.ClearContents
.Cells.ClearFormats
End With
MsgBox ("Sheet [2] is cleared now")
End Sub
Source: ---
Disclaimer: The information in this webpage is shared by anonymous users from external online sources. We cannot guarantee its accuracy or truthfulness. Users should exercise caution and verify information independently.