Data Mapping column variables

mas550

New Member
Joined
Jan 4, 2011
Messages
20
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

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:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top