Function LinkedSheet(rgCell As Range) As Worksheet
'Returns the worksheet that the cell formula references
'Returns nothing if there's no formula
Dim strFormula As String
strFormula = rgCell.Cells(1, 1).Formula
If (strFormula <> "") Then
'Return the sheet that this range is linked to
End If
End Function
이 기능을 완료하는 데 도움을 줄 수있는 사람이 있습니까? 이 싯다 르트 나라 얀 패주에 대응하여, 내가 이전셀 수식에서 참조하는 워크 시트를 얻는 방법
Function LinkedSheet(rgCell As Range) As Worksheet
'Returns the worksheet that the cell formula references
'Returns nothing if there's no formula
Dim strFormula As String, sheetName As String
strFormula = rgCell.Cells(1, 1).Formula
If (strFormula <> "") Then
'Return the sheet that this range is linked to
sheetName = Mid(strFormula, 2, InStr(1, strFormula, "!") - 2)
Set LinkedSheet = ThisWorkbook.Worksheets(sheetName)
End If
End Function
을 시도 :이 편집
"시트 1"과 같은 이름의 공간이 시트에 내부 링크, 외부 링크 및 링크 작동한다는 것을 명심하십시오
이름에 공백이있는 시트의 경우 실패합니다. 그러나 나는 문제를 다루는 더 효율적이고 효율적인 방법이 있어야한다고 느꼈기 때문에 나는 이것을 게시하는 것을 꺼려했다. 나는 내가가는 방향과 같은 방향으로 사람들의 생각을 터뜨리고 싶지 않았다.
시도해 보셨습니까? 코드를 묻는 질문은 해결하려는 문제에 대한 최소한의 이해를 보여 주어야합니다. 시도한 해결책, 실패한 이유 및 예상되는 결과를 포함하십시오. 참고 항목 : [Stack Overflow question checklist] (http://meta.stackexchange.com/questions/156810/stack-overflow-question-checklist) –
http://www.vbaexpress.com/forum/showthread.php?19348 -solved-Splitting-all-in-a-formula & p = 142863 # post142863 –
잠깐 생각한 것처럼 : 수식에'!'의 위치를 찾으십시오. 문자열 – Barranka