컴퓨터활용능력1급/컴활1급 실기

취성패_컴활1급_25일차 <엑셀 최신기출15회>

삼토 2016. 12. 23. 18:47

  • 매크로 할 때 엔터치기 전 오타 정도는 괜찮다. 엔터치면 실행이 인식되므로 문제.

  • 매크로 끝낸 후에 실행하지 않기!!!!

 

그림영역 서식

차트영역 서식

데이터계열 서식 보조축

 

* 스핀단추 누를 때마다 ㅡ숫자 증가되도록 하려면

: 옆에 붙은 게 txt판매수량이므로 이걸 스핀단추와 연계해준다

Private Sub spn수량_Change()

txt판매수량 = spn수량

End Sub

 

 

 

 

* 리스트 달 때는 (필드 포함해서) 행이나 열이나 0부터 시작함

: Cells(8, 2) = lst품목.List(1, 0)

셀의 8,2 위치에는 폼의 lst품목 에서 1 0열의 값을 넣어라

 

 

문제4

<2>-3 답 

  1. 일단 첫 행을 8 1이라는 상수로 잡고 시작한다. 직관적으로 구조를 잡고 난 후 세부적으로 들어갈 것.

Cells(8, 2) = lst품목.List(1, 0)

Cells(8, 3) = lst품목.List(1, 1)

Cells(8, 4) = lst품목.List(1, 2)

Cells(8, 5) = txt판매수량.Value

Cells(8, 6) = txt판매수량.Value * lst품목.List(1, 3)

 

2. 행 8 바꿔주기


i = Range("b5").CurrentRegion.Rows.Count + 5

i = Range("b5").CurrentRegion.Rows.Count + 5

 

 

Cells(i, 2) = lst품목.List(1, 0)

Cells(i, 3) = lst품목.List(1, 1)

Cells(i, 4) = lst품목.List(1, 2)

 

Cells(i, 5) = txt판매수량.Value

 

Cells(i, 6) = txt판매수량.Value * lst품목.List(1, 3)

 

3. 행 1 바꿔주기

lst품목.listindex à

lst품목을 쓰면 선택한 것이 나오고,

listindex는 거기에서 선택한 것이 몇 번째인지 숫자로 변환해줌 


Cells(i, 2) = lst품목.List(lst품목.ListIndex, 0)

Cells(i, 3) = lst품목.List(lst품목.ListIndex, 1)

Cells(i, 4) = lst품목.List(lst품목.ListIndex, 2)

Cells(i, 5) = txt판매수량.Value

Cells(i, 6) = txt판매수량.Value * lst품목.List(lst품목.ListIndex, 3)




* 반복되는 것은 치환해주자

J = lst품목.listindex

(아예 시험삼아 숫자로 넣어봤으면 바로 문자로 치환한 상태에서 식을 세우장)


i = Range("b5").CurrentRegion.Rows.Count + 5

j = lst품목.ListIndex 

Cells(i, 2) = lst품목.List(j, 0)

Cells(i, 3) = lst품목.List(j, 1)

Cells(i, 4) = lst품목.List(j, 2)

Cells(i, 5) = txt판매수량.Value

Cells(i, 6) = txt판매수량.Value * lst품목.List(j, 3)