Learn VBA, just to make a small tool for finance:
Sub Open Personnel Information table () Dim WB as Workbook, C as Integer Set WB= Workbooks.Open ("C:\Users\wzn\Documents\ Workbook 2.xlsx",0, True) c=WB. Worksheets.count If C<3Then WB. Worksheets.add after:=Worksheets (worksheets.count) WB. Worksheets (1). Select End SubSub Add selected person () Dim FW as Worksheet, LW as Worksheet, fr As Integer, LR As Integer, RG as Range Set FW =ActiveSheet Set LW=Worksheets (worksheets.count) for each RG in Selection fr=RG. Row If Range ("a"& FR) =""Or Range ("b"& FR) =""Then MsgBox"The selected item cannot be a null value, please verify that the item is selected and try again"Exit Sub End If LR= LW. Range ("a65536"). End (Xlup). Row +1LW. Range ("a"& LR) = Range ("a"&fr) LW. Range ("b"& LR) = Range ("b"&fr) Next If LW. Range ("A1") <>"name"Then LW. Range ("A1") ="name"LW. Range ("B1") ="Card number"LW. Range ("C1") ="Amount"With LW. Range ("A1,B1,C1"). Font. Name="Song Body" . Size= A . Bold=True End With end If with LW. Range ("A1"). CurrentRegion. Borders.colorindex=1 . Columns.AutoFit. HorizontalAlignment=xlcenter End WithEnd SubSub Export Add people () Dim LW as Worksheet, Curbook as Workbook Set curbook=ActiveWorkbook Set LW=Worksheets (worksheets.count) LW. Move curbook.close falseend Sub
VBA Practice-Open a file, add a check, and create a new table