VBA Question -Where is the source data

PHIL.Pearce84

Board Regular
Joined
May 16, 2011
Messages
152
Office Version
  1. 365
Platform
  1. Windows
Hi,

am looking at a former colleagues spreadsheet, and I am trying to determine where h data is company is? But am at a complete lost????

please help, code is below:
Code:
Sub Fileoutput()
' Applies combination of corrections and successfull lookup data into format ready for upload
Dim C, D
Application.ScreenUpdating = False
For C = 2 To 60000
If Sheets("Upload Data Copy").Range("T" & C).Value = "" Then
Exit For
End If
For D = 4 To 2000
If Sheets("Upload Data Copy").Range("T" & C).Value = "No Lookup Information Found" Then
If Sheets("Upload Data Copy").Range("C" & C).Value = Sheets("Errors").Range("A" & D + 2).Value Then
Sheets("Upload Data Copy").Range("V" & C).Value = Sheets("Errors").Range("G" & D + 2).Value
Sheets("Upload Data Copy").Range("F" & C).Value = Sheets("Errors").Range("D" & D + 2).Value
End If
Else
Sheets("Upload Data Copy").Range("V" & C).Value = Sheets("Upload Data Copy").Range("T" & C).Value
Exit For
End If
Next D
Next C
' Formats data worksheet ready for upload
    Sheets("Upload Data Copy").Visible = True
    Sheets("Upload Data Copy").Select
    Cells.EntireColumn.AutoFit
    Cells.HorizontalAlignment = xlLeft
    
    Sheets("Errors").Visible = xlVeryHidden
    Sheets("Upload Data").Visible = xlVeryHidden
    Sheets("Upload Data Copy").Select
    
    Range("V1").Select
    Selection.Locked = True
    Selection.FormulaHidden = True
    ActiveCell.FormulaR1C1 = "Frameworks Technician ID"
    Columns("T:U").Select
    Selection.Delete Shift:=xlToLeft
    
    Columns("E:E").Select
    Selection.Insert Shift:=xlToRight
    
    Columns("M:M").Select
    Selection.Delete Shift:=xlToLeft
    Columns("R:S").Select
    Selection.Delete Shift:=xlToLeft
    Columns("Q:Q").Select
    Selection.Insert Shift:=xlToRight
    Selection.Insert Shift:=xlToRight
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "Delivery Note Line No"
    Range("Q1").Select
    ActiveCell.FormulaR1C1 = "Quantity UOM Description"
    Range("R1").Select
    ActiveCell.FormulaR1C1 = "Price UOM Description"
    
    Range("A2").Select
    
Application.ScreenUpdating = True
End Sub
 
Last edited by a moderator:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
What does this mean??

Sorry bit of a mis type.

Basically the user is asked to dump a report into a tab, a button then appears and the MACRO runs some form of check to identify any errors. What I am trying to determine is what is he comparing the imported data to in order to identify the error? This will allow met to create a new report within system.

Hope that helps?
 
Upvote 0
It looking in column T of 'Upload Data Copy' sheet for cells which say 'No Lookup Information Found'. How that gets there this macro doesnt help in establishing.
 
Upvote 0
It looking in column T of 'Upload Data Copy' sheet for cells which say 'No Lookup Information Found'. How that gets there this macro doesnt help in establishing.

Thank you really appreciate it. Now I just need to find that tab as there are no tabs with that name on the sheet
 
Upvote 0
It's probably a very hidden sheet, try
Code:
Sheets("Upload Data Copy").Visible=xlSheetVisible
 
Upvote 0

Forum statistics

Threads
1,215,898
Messages
6,127,634
Members
449,392
Latest member
Kersh82

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