Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2015, 03:44 AM
cmreddy.vba cmreddy.vba is offline How to search with column heading then doing the lookup action for below code Windows 7 64bit How to search with column heading then doing the lookup action for below code Office 2010 64bit
Novice
How to search with column heading then doing the lookup action for below code
 
Join Date: Jan 2015
Location: Bangalore, India
Posts: 1
cmreddy.vba is on a distinguished road
Default How to search with column heading then doing the lookup action for below code


Below mentioned code will insert new column called ISR/CSSM Mapped based on column D and from D2 values. But i dont want to mention the D and D2 insted i want mention column heading then seach for lookup value. Can any one help me?



Sub InsertColumn()

Dim lLastRow As Long
Dim oWorksheet As Worksheet
Dim oLookupSheet As Worksheet
Dim rEmailRange As Range
Dim vCell As Variant
Dim lRowCount As Long

lRowCount = 2
Set oWorksheet = Worksheets("AP_Quotes_20140928-020000")
Set oLookupSheet = Worksheets("ISR CSSMs")

On Error Resume Next
oWorksheet.Range("E:E").Insert
oWorksheet.Cells(1, 5).Value = "ISR/CSSM Mapped"
lLastRow = oWorksheet.Cells(Rows.Count, 4).End(xlUp).Row
Set rEmailRange = oWorksheet.Range("d2:d" & lLastRow)

For Each vCell In rEmailRange
oWorksheet.Cells(lRowCount, 5).Value = Application.WorksheetFunction.VLookup(vCell.Value, oLookupSheet.Range("B2:C719"), 2, 0)
lRowCount = lRowCount + 1
Next vCell

End Sub
Attached Files
File Type: zip Delete Duplicate .zip (143.9 KB, 8 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to search with column heading then doing the lookup action for below code Need code to Parse and arrange data based on heading winmaxservices2 Excel Programming 1 01-01-2015 01:04 AM
VBA to search each row of a word table column Marrick13 Word VBA 7 11-17-2014 04:33 AM
How to search with column heading then doing the lookup action for below code How to line up a merged field to a column heading j_Southern Mail Merge 2 10-08-2012 12:28 PM
How to link an action on one slide on a powerpoint with the same action on another slevinmj PowerPoint 0 02-24-2011 05:38 AM
How to search with column heading then doing the lookup action for below code Need to search a column for a macth and return a result from a third column pdfaust Excel 2 02-03-2011 03:02 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft