#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 103
Default simple macro

I use the vlookup on dozens of sheets each day, always returning #n/a
somewhere in the column. So I copy, paste value, then replace #n/a with
nothing.

When I tried to make a macro do do it, instead of the highlighted range on
the new sheet it wanted to find the original sheet and ranges.

What do I need to look at whatever is highligted on the active sheet, copy,
paste value, and replace #n/a with nothing?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 360
Default simple macro

You could use isna in your formulas to keep the na values from
appearing:

=IF(ISNA(VLOOKUP(B1,$D$1:$E$7,2,FALSE)),"",(VLOOKU P(B1,$D$1:$E
$7,2,FALSE)))

Cliff Edwards



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 103
Default simple macro

way too much to type 50 times a day, especially in sheets that are already at
or past the limit of my 1GB of ram.

"ward376" wrote:

You could use isna in your formulas to keep the na values from
appearing:

=IF(ISNA(VLOOKUP(B1,$D$1:$E$7,2,FALSE)),"",(VLOOKU P(B1,$D$1:$E
$7,2,FALSE)))

Cliff Edwards




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 360
Default simple macro

You only have to enter them once... then you can copy or fill the
rest. Are you typing/using the function wizard to enter the vlookups?

Cliff Edwards
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 103
Default simple macro

I just tried recordin the macro again and this time it worked.

I end up typing it in several different columns, in several different
worksheets every day, looking for information on different sheets, typically
dragging it down anywhere from 300 lines to 6500 lines, depending on the
sheet I'm working with.

"ward376" wrote:

You only have to enter them once... then you can copy or fill the
rest. Are you typing/using the function wizard to enter the vlookups?

Cliff Edwards



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 360
Default simple macro

Sub Macro1()
With ActiveSheet.UsedRange
.Value = .Value
.Replace What:="#N/A", _
Replacement:="", _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
MatchCase:=True, _
SearchFormat:=False, _
ReplaceFormat:=False
End With
End Sub
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 360
Default simple macro

I can't recommend using this but you could also do this:

Sub Macro1()
Dim c As Range
For Each c In ActiveSheet.UsedRange
If c.Text = "#N/A" Then c.Formula = ""
Next
End Sub

Cliff Edwards
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 360
Default simple macro

Change "Activesheet.usedrange" to "Selection" in the examples.

Cliff Edwards

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
maybe it's simple with macro for this one? driller Excel Worksheet Functions 6 July 16th 07 05:12 PM
Simple (?) Macro NeedHelp Excel Discussion (Misc queries) 3 January 21st 07 10:39 PM
Simple Macro sparx Excel Discussion (Misc queries) 4 May 12th 06 06:25 AM
Simple macro help chip_pyp Excel Discussion (Misc queries) 3 January 10th 06 07:57 PM
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 07:37 PM


All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"