Skip to content
Excel
2012.07.16 16:20

[excel] GET.CELL사용법

조회 수 26600 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

[excel] GET.CELL사용법


http://www.sulprobil.com/html/get_cell.html

You can retrieve interesting information about worksheet cells by using the Excel4 macro function GET.CELL. Define the name HasFormula with the value
=GET.CELL(48,INDIRECT("RC[-1]",FALSE))
for example. If you now insert =HasFormula next right to a cell, you will be shown whether the cell has a formula (True) or not (False).

Another example for GET.CELL you can find here.

An overview over some arguments for GET.CELL:

Proposed Name

Arg #

What =GET.CELL(Arg #,INDIRECT("RC[-1]",)) will return

AbsReference

1

Absolute style reference like [Book1.xls]Sheet1!$A$1

ShowValue

5

Cell value

ShowFormula

6

Cell formula

NumFormat

7

Number format of cell

IsLocked

14

True if cell is locked

FormulaHidden

15

True if cell formula is hidden

ShowWidth

16

Cell width. If array-entered into two cells of a row, second value is true if width is standard

ShowHeight

17

Cell height

WorkbookName

32

Workbook name like [Book1.xls]Sheet1 or Book1.xls if workbook and single sheet have identical names

ShowFormulaWOT

41

Cell formula without translation into language of workspace

HasNote

46

True if cell has a text note

HasFormula

48

True if cell contains a formula

IsArray

49

True if cell is part of an array formula

IsStringConst

52

Text alignment char ' if cell is a string constant, empty string if not

AsText

53

Cell displayed as text with numbers formatted and symbols included

WorksheetName

62

Worksheet name like [Book1.xls]Sheet1

WorkbookName

66

Workbook name like Book1.xls

IsHidden

 

VBA only: True if cell is hidden (the entire row or column, actually)

If you want to achieve similar results with VBA use this UDF:

Function sbGetCell(r As Range, s As String) As Variant
'Reverse("moc.LiborPlus.www") V0.11 PB 29-Jan-2011
Application.Volatile
Select Case s
Case "AbsReference", "1"
    'Absolute style reference like [Book1.xls]Sheet1!$A$1
    If Application.Caller.Parent.Parent.Name = r.Worksheet.Parent.Name And _
        Application.Caller.Parent.Name = r.Worksheet.Name Then
        sbGetCell = r.Address
    Else
        If InStr(r.Worksheet.Parent.Name & r.Worksheet.Name, " ") > 0 Then
            sbGetCell = "'[" & r.Worksheet.Parent.Name & "]" & r.Worksheet.Name & "'!" & r.Address
        Else
            sbGetCell = "[" & r.Worksheet.Parent.Name & "]" & r.Worksheet.Name & "!" & r.Address
        End If
    End If
Case "ShowValue", "5"
    'Cell value
    sbGetCell = r.Value
Case "ShowFormula", "6"
    'Cell formula
    sbGetCell = r.FormulaLocal
Case "NumFormat", "7"
    'Number format of cell
    sbGetCell = r.NumberFormatLocal
Case "IsLocked", "14"
    'True if cell is locked
    sbGetCell = r.Locked
Case "FormulaHidden", "15"
    'True if cell formula is hidden
    sbGetCell = r.FormulaHidden
Case "ShowWidth", "16"
    'Cell width. If array-entered into two cells of a row, second value is true if width is standard
    sbGetCell = r.ColumnWidth 'Not width!
Case "ShowHeight", "17"
    'Cell height
    sbGetCell = r.RowHeight
Case "WorkbooksheetName", "32"
    'Workbook name like [Book1.xls]Sheet1 or Book1.xls if workbook and single sheet have
    'identical names
    If r.Worksheet.Parent.Name = r.Worksheet.Name & ".xls" And _
        Application.Worksheets.Count = 1 Then
        sbGetCell = r.Worksheet.Parent.Name
    Else
        sbGetCell = "[" & r.Worksheet.Parent.Name & "]" & r.Worksheet.Name
    End If
Case "ShowFormulaWOT", "41"
    'Cell formula without translation into language of workspace
    sbGetCell = r.Formula
Case "HasNote", "46"
    'True if cell has a text note
    sbGetCell = Len(r.NoteText) > 0
Case "HasFormula", "48"
    'True if cell contains a formula
    sbGetCell = r.HasFormula
Case "IsArray", "49"
    'True if cell is part of an array formula
    sbGetCell = r.HasArray
Case "IsStringConst", "52"
    'Text alignment char "'" if cell is a string constant, empty string "" if not
    sbGetCell = r.PrefixCharacter
Case "AsText", "53"
    'Cell displayed as text with numbers formatted and symbols included
    sbGetCell = Format(r.Value, r.NumberFormatLocal)
Case "WorksheetName", "62"
    'Worksheet name like [Book1.xls]Sheet1
        sbGetCell = "[" & r.Worksheet.Parent.Name & "]" & r.Worksheet.Name
Case "WorkbookName", "66"
    'Workbook name like Book1.xls
    sbGetCell = r.Worksheet.Parent.Name
Case "IsHidden"
    'Cell hidden?
    sbGetCell = r.EntireRow.Hidden Or r.EntireColumn.Hidden
Case Else
    sbGetCell = CVErr(xlErrValue)
End Select

End Function

로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
837 컴퓨터잡담 [JavaScript] 자바스크립트 함수 총정리!! 3 2010.03.27 12514
836 컴퓨터잡담 ajax의 XMLHttpRequest 객체 1 2010.03.27 7463
835 컴퓨터잡담 Prototype.js를 제대로 사용하는 방법 2010.03.27 10299
834 컴퓨터잡담 50 개 이상의 Ajax 예제들 2 2010.03.29 18950
833 컴퓨터잡담 50 개 이상의 Ajax 예제들 2010.03.29 18179
832 컴퓨터잡담 php에서 script로 변수 전달 후 html에 div로 내용 출력하기 1 3 2010.04.01 15904
831 컴퓨터잡담 부팅시 에러 메시지 PRESS F1 to REsume 2 2010.04.03 16109
830 컴퓨터잡담 로그인 아이디 쿠키로 기억하기 2010.04.05 10966
829 컴퓨터잡담 MySQL을 위한 하드웨어 최적화(What one can and should optimize) 2 2010.04.06 13123
828 컴퓨터잡담 MYSQL my.cnf 최적화 15 2010.04.07 22600
827 컴퓨터잡담 삼성, 프로그래머들에게 스마트폰 콘텐츠 개발하고 싶게 만들어라. 2 2010.04.09 10989
826 컴퓨터잡담 쓸데없는 시작 프로그램을 없애자 2010.04.10 6107
825 컴퓨터잡담 MYSQL Qcache 값 조정~~~ 1 2010.04.13 19554
824 컴퓨터잡담 mysql threads_created 뭐냥? 4 2010.04.13 12244
823 컴퓨터잡담 svchost.exe 프로세스로 내컴퓨터 최적화 시키기 2010.04.14 7366
822 컴퓨터잡담 MySQL 조율(튜닝)에 대해 2 2010.04.14 15827
821 컴퓨터잡담 MySQL FEDERATED / InnoDB is disabled, myint64.dll 오류 어찌하오리 4 2010.04.19 27709
820 컴퓨터잡담 서버에 SSD 교체 작업을 해야되나? 2010.04.20 6522
819 컴퓨터잡담 DB MyISAM, InnoDB 입출력 처리방식 3 2010.04.20 13812
818 컴퓨터잡담 블로그/사이트의 키워드 훔쳐보기^^;; 2010.04.21 9207
Board Pagination Prev 1 ... 3 4 5 6 7 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소