Current location - Education and Training Encyclopedia - Education and training - Excel VBA worksheet operation?
Excel VBA worksheet operation?
The run prompt is that next has no for, because if range(" e "&;; I) = "female" then this line is wrong.

You should add an endIf line above the If, or change the if line to ElseIf.

In addition, you write the code and title before deleting the line, so if it is a line that needs to be deleted, it is unnecessary.

I'll write it for you again:

Child operation ()

Dim s%, i%' defines s as an integer and I as an integer.

For s = 1 to 8' traversal 1 to 8. By default, the step size is 1.

Zhang. Select' select s table.

for I = Range(" B " & amp; Ok. cout)。 End (3). Rowto2step-1' traverses the maximum row of column B and counts to 2, with the step size of-1.

If range ("D"&) = ""Then

Line (I). Delete the first line.

other

name of code

If range ("B"&) = "science and engineering" then

Range ("C" & ampi) = "LG "

ElseIf range ("B"&) = "liberal arts" then

Range ("C" & ampi) = "WK "

ElseIf range ("B"&) = "finance"

Range ("C" & ampi) = "CJ "

If ... it will be over.

address

If range ("E"&) = "male"

Scope ("F"&) = "sir"

Ersev range ("E"&) = "female"

Scope ("F"&) = "madam"

If ... it will be over.

If ... it will be over.

Next, I

The next s

MsgBox "done!" ,, "Prompt" pop-up prompt

End joint