Current location - Quotes Website - Personality signature - Macros about filling in names
Macros about filling in names
What you said is not easy to handle. I think of a simple way, which is a macro. When you run it, it will ask you two contents, the first is the basis of the query, and the second is the content that needs to be filled in. When it asks you, you can click "Cancel" to cancel the execution of this macro. )

When necessary, you perform it once and fill in a content. You can define a shortcut key or icon for it to call it quickly.

You can put this macro in your personal macro workbook so that you can call it in all files at any time.

The code is as follows:

Child automatic name ()

Dim mySheet as worksheet, myCell as range, myName as string and FindIt as string.

FindIt = InputBox ("Please enter the cell contents you need to find"&; Chr (13) chr (13) "Excel will fill in the following cell", "signature")

If FindIt = ""then exit Sub.

MyName = InputBox ("Please enter what you need to fill in"&; Chr (13) chr (13) "Excel will fill in the cell when it is found", "")

If myName = ""then exit Sub.

For each mySheet in the ActiveWorkbook. worksheet

My sheets. choose

Set myCell = Cells. Find(What:=FindIt,looking:= XL formulas,LookAt:= _

xlWhole,SearchOrder:=xlByRows,SearchDirection:=xlNext,MatchCase:=False _

,MatchByte:=False,SearchFormat:=False)

If it is not, it is nothing. Offset (0, 1). Value = my name

Next sheet of my worksheet

MsgBox "Processing complete!" , VB information

End joint

Good luck!