drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 527
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and thanks in advance!
I have a table containing 7 columns, the headers are
But when the closed file's cell is empty I get 0 and I have to avoid this problem
Sometimes the files has 0 values, So I need those zeros, not the one coming when the cell is empty
I was trying to use a formula using a macro:
But does not work
Any idea?
I have a table containing 7 columns, the headers are
- PATH 'the path always comes and/or ends with \
- SHEET NAME 'The Sheet always exist
- File Extension 'Eg .xlsx Always a excel file and always comes with a . as the firt character. I Mean I do not have to care
- Sheet Name 'Eg: Sheet1
- Cell address 'Always just one cell eg: F6 or V74, never A5:F45
But when the closed file's cell is empty I get 0 and I have to avoid this problem
Sometimes the files has 0 values, So I need those zeros, not the one coming when the cell is empty
I was trying to use a formula using a macro:
VBA Code:
Sub Macro2()
On Error Resume Next
Dim wPath As String: wPath = "='" & Range("E12") 'eg "E:\000_ExcelProjects\NewJob 2020-11-12\Files\"
Dim wFileName As String: wFileName = "[" & Range("f12")
Dim wFileExtension As String: wFileExtension = Range("g12") & "]"
Dim wShtName As String: wShtName = Range("h12") & "'!"
Dim wCellAddress As String: wCellAddress = Range(Range("j12")).Address(ReferenceStyle:=xlR1C1)
' ActiveCell.FormulaR1C1 = "='E:\000_ExcelProjects\NewJob 2020-11-12\Files\[SIE_0101_01546_01A01546_202010.xlsx]dat cart'!R[-11]C[-6]"
ActiveCell.FormulaR1C1 = wPath & wFileName & wShtName & wCellAddress
End Sub
But does not work
Any idea?