Excel and NSLOOKUP

eric7753

New Member
Joined
Dec 30, 2009
Messages
9
My initial goal is to use the command NSLOOKUP via Excel and VBA. In column A I will have a list of IP addresses in xxx.xxx.xxx.xxx format and would like to create a macro that can call NSLOOKUP and report the results of the lookup in the corresponding cell in column B.
Example:
A1 B1
192.168.101.154 myhomecomputer.domain.com

I have found several scripts that come close to this request, but don’t quite complete the task. Does anyone have a script in their bag of tricks they could share?
I am using windows XP, Excel 2007, and am on a domain.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Welcome to the forums!

As tuffluck says, what you want is VLOOKUP.

The way you call this in a macro is Application.WorksheetFunctions.VLOOKUP(*value to look up*, *range to look in*, *column to return*, *true/false*)
 
Upvote 0
Post your best attempt and maybe someone can help to tweak the script.

Also, why do you need NSLOOKUP? Couldn't you use Ping instead?
 
Upvote 0

Forum statistics

Threads
1,215,360
Messages
6,124,492
Members
449,166
Latest member
hokjock

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