I have several sheets in a worksheet called 1, 2, 3, 4, 5, 6, 7....
and I need to Copy all the files in 1 single Sheet.
I can't find the way to right now only one " to give the name to the sheet.
The problem happens here:
varNBLIGNES = Sheets(""" & varDC & """).Range(COLNUM & ":" & COLNUM).Cells.SpecialCells(xlCellTypeConstants).Count
'CONSTANTS
Const COLNUM As String = "B" 'PART NUMBERS WILL ALWAYS BE IN THE B COLUM FOR EVERY EXCEL FILES
Const COLPRC As String = "C" 'NEW LIST PRICE WILL ALWAYS BE IN THE C COLUM FOR EVERY EXCEL FILES
Const COLDSC As String = "Q" 'NEW DESCRIPTION WILL ALWAYS BE IN THE Q COLUM FOR EVERY EXCEL FILES
Const COLUOM As String = "S" 'NEW UNIT OF MESURE WILL ALWAYS BE IN THE S COLUM FOR EVERY EXCEL FILES
Const COLUIP As String = "T" 'NEW UNIT IN PACKAGE WILL ALWAYS BE IN THE T COLUM FOR EVERY EXCEL FILES
Const vbDoubleQuote As String = """"
'VARIABLES
Dim varNBLIGNES As Integer
Dim varDC As Integer
Dim varDCS As String
Dim i As Integer
Dim quote As String
'INITIALIZATION
varNBLIGNES = 0
varDC = Sheets(2).Range("P5").Value
varDCS = ""
i = 1
quote = Chr(34)
'SUB CODE TO COMPILE FILES INTO ONE
'While varDC >= i
varNBLIGNES = Sheets(""" & varDC & """).Range(COLNUM & ":" & COLNUM).Cells.SpecialCells(xlCellTypeConstants).Count
varNBLIGNES = varNBLIGNES + 1
Sheets(varDC).Range("B3:" & COLNUM & varNBLIGNES).Copy
Sheets(4).Select
Range("B4").Select
ActiveSheet.Paste
'Sheets("PROD FOUR").Select
'Range("B4").Select
'ActiveSheet.Paste
'varDC = varDC - 1
'Wend
As you can see I tried to declare it in a CONST, I also tried to create the "CHR(34)" and everything seams to fail.
What am I doing wrong? Thanks you in advance