Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default VLOOKUP works but gets #REF when macro changes formulas to values

I have a range of templates using VLOOKUP to get data from a separate file
and enter it in columns C and E, within the range A18:E1018. Macro code as
follow
--------------------------------------------------------------------------------
Sub Quote_Wrapup()
'To stop screen flicker
Application.ScreenUpdating = False

Range("D8:E9").ClearContents
Range("qdata5,qdata6").Font.ColorIndex = 2
Range("A18:A1018").SpecialCells(xlCellTypeBlanks). EntireRow.Delete
Columns("A:E") = Columns("A:E").Value
ActiveSheet.Shapes("Picture 14").Delete
Columns("A:F").Interior.ColorIndex = xlNone
Range("commission").ClearContents
Sheets("Instructions").Select
ActiveSheet.Name = "Terms&Conditions"
Rows("1:32").Clear
Rows("1:32").Delete
ActiveSheet.Shapes("Object 1").Delete
Range("A1").Select
Sheets("Quotation").Select
Range("qdata1").Select
Dim vbCom As Object

Call logquote

Application.ScreenUpdating = True

On Error Resume Next

'Set vbCom = Application.VBE.ActiveVBProject.VBComponents
Set vbCom = ActiveWorkbook.VBProject.VBComponents

vbCom.Remove VBComponent:= _
vbCom.Item("Module3")

vbCom.Remove VBComponent:= _
vbCom.Item("Module4")

On Error GoTo 0

End Su
--------------------------------------------------------------------------------
One user (and only one) can see the data fine but when the macro is run the
data in column E changes to #REF rather than the value, column C converts to
the value OK.

Unfortunately, the user seems unable to tell me what they are doing
differently or give me an example :-(

From looking at the code can anyone see why this might be happening?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default VLOOKUP works but gets #REF when macro changes formulas to values



"Code Numpty" wrote:

I have a range of Excel 2003 templates using VLOOKUP to get data from a separate file
and enter it in columns C and E, within the range A18:E1018. Macro code as
follows
--------------------------------------------------------------------------------
Sub Quote_Wrapup()
'To stop screen flicker
Application.ScreenUpdating = False

Range("D8:E9").ClearContents
Range("qdata5,qdata6").Font.ColorIndex = 2
Range("A18:A1018").SpecialCells(xlCellTypeBlanks). EntireRow.Delete
Columns("A:E") = Columns("A:E").Value
ActiveSheet.Shapes("Picture 14").Delete
Columns("A:F").Interior.ColorIndex = xlNone
Range("commission").ClearContents
Sheets("Instructions").Select
ActiveSheet.Name = "Terms&Conditions"
Rows("1:32").Clear
Rows("1:32").Delete
ActiveSheet.Shapes("Object 1").Delete
Range("A1").Select
Sheets("Quotation").Select
Range("qdata1").Select
Dim vbCom As Object

Call logquote

Application.ScreenUpdating = True

On Error Resume Next

Set vbCom = ActiveWorkbook.VBProject.VBComponents

vbCom.Remove VBComponent:= _
vbCom.Item("Module3")

vbCom.Remove VBComponent:= _
vbCom.Item("Module4")

On Error GoTo 0

End Sub
--------------------------------------------------------------------------------
One user (and only one) can see the data fine but when the macro is run the
data in column E changes to #REF rather than the value, column C converts to
the value OK.

Unfortunately, the user seems unable to tell me what they are doing
differently or give me an example :-(

From looking at the code can anyone see why this might be happening?

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
adding vlookup values in a macro alenhart Excel Discussion (Misc queries) 0 June 29th 09 01:04 AM
Macro to paste special value only VLOOKUP formulas jeremy nickels Excel Programming 3 February 9th 09 12:57 AM
Sum in vba only works for multiple values not for single values?? Bevy Excel Programming 0 June 15th 06 11:39 AM
vlookup formulas returning no values Mogle Excel Worksheet Functions 5 August 11th 05 04:50 PM
Vlookup Macro to return Values only Ian[_12_] Excel Programming 2 July 8th 04 03:41 AM


All times are GMT +1. The time now is 10:26 PM.

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

About Us

"It's about Microsoft Excel"