ok i am stuck ... after fiannly figuingout how to get my data mapping to work i cant figure out how to make the variable the coulmn number in my formulas.
for example i want to call out cell porgc & lc.
i am attempting to use 1 macro to run the same checks on workbooks with different formats all containing the same information.
i really hope this makes sense to somebody -- below is the function i am using to get my column referances, i have the user select the column the desired information is in and use the couliumn number as a variable (or at least thats the plan)
i was told i will need to use an indirect statment, but i cant find anything online like what i am tring to do... i am going to need some help from someone way more advanced at this then i am
for example i want to call out cell porgc & lc.
i am attempting to use 1 macro to run the same checks on workbooks with different formats all containing the same information.
i really hope this makes sense to somebody -- below is the function i am using to get my column referances, i have the user select the column the desired information is in and use the couliumn number as a variable (or at least thats the plan)
i was told i will need to use an indirect statment, but i cant find anything online like what i am tring to do... i am going to need some help from someone way more advanced at this then i am
Code:
Function DataMapping()
Dim poRange As Range
Dim CPNRange As Range
Dim QTYRange As Range
Dim DDRange As Range
Dim CommentRange As Range
Dim porgc As Integer
Dim CPNRgc As Integer
Dim QTYRgc As Integer
Dim DDRgc As Integer
Dim Comrgc As Integer
Set poRange = Application.InputBox("Please select PO#", "Select", , , , , , 8)
porgc = poRange.Column
Set CPNRange = Application.InputBox("Please select Cust PN", "Select", , , , , , 8)
CPNRgc = CPNRange.Column
Set QTYRange = Application.InputBox("Please select Order QTY", "Select", , , , , , 8)
QTYRgc = QTYRange.Column
Set DDRange = Application.InputBox("Please select Dock Date", "Select", , , , , , 8)
DDRgc = DDRange.Column
Set CommentRange = Application.InputBox("Please select Comment Field", "Select", , , , , , 8)
Comrgc = CommentRange.Column
End Function
Last edited: