[빈 셀 자동 채우기]

Sub Mytestmacro1()
'
' Mytestmacro1 매크로
'

'범위 선택
Range("B2").CurrentRegion.Select

'빈셀 선택
Selection.SpecialCells(xlCellTypeBlanks).Select

'셀 채우기를 노란색으로 변경
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With

'선택된 셀의 값을 "미제출 입력"
Selection.FormulaR1C1 = "미제출"

End Sub

 




 

[비만도 계산]

Function BMI(Weight, Height)

BMI = Weight / (Height / 100) ^ 2

End Function

 




 

[주민번호 성별추출]

Function ID_ Gender (ID)
ID_Gender = WorksheetFunction.lsOdd(Mid(ID, 8, 1))
IID Gender = True Then
ID Gender = "남자"
Else
ID Gender = "여자"
End If

End Function


[1번째 세션 미션_FindGender 함수]

'함수명 정의

Function FindGender(Name)

'함수 정의

FindGender = Application.WorksheetFunction.VLookup(name,Sheets("빈셀자동채우기").Range("B2:g15"),2,0)

'함수 종료

End Function