Dear Forum,
I have data spread over several columns and this data is added from different files which has a different format than the one required to be in the Consolidated File.
I get results from a portal for Insurance certification, which has Exam Date, Issue Date and Validity Date which is copied manually and pasted from this file and to my master consolidated sheet...then I have to fetch other details for these certified employees from the HR Database which has the data in different formats...
So have to manually copy the format from the previous rows and then copy to the copied data, since this is done more than once in a day its tedious and time consuming so can this be done with a Macro..
I made my own small code but dont know how to make it act differently on selected columns....
I would select the entire matrix and then want the macro to run differently, taking into consideration the column names
Sub Text_Selection()
Dim myRange As Range
Set myRange = Selection
'This is for COl B
Selection.TextToColumns Destination:=myRange, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 2), TrailingMinusNumbers:=True
End Sub
I also need to add a vlookup formula for some column based on the column B's value...
Ex: ;this is for Col C
=if(isna(vlookup($B2,Emp Dump$A:$AA,17,0)),if(isna(vlookup($B2,Emp Dump$A:$AA,17,0)),vlookup($B2,Emp Dump$A:$AA,17,0), vlookup($B2,Emp Dump$A:$AA,17,0)))
So how do I write the code in such a way that the code acts on its own differently
Regards
e4excel
Bookmarks