Solved

Add extra step to current macro

Posted on 2016-08-18
6
37 Views
Last Modified: 2016-08-19
Hi Experts Using Excel 2013

I have the following macro which i would like to add an additional step too.
So based in the last cell in column B add the following formula to cell A2 =IFERROR(OFFSET(Data!DR2,MATCH(B2,Data!$DR$2:$DR$1303,0),-83),"")

into the VBA code...

Sub CopyandPasteValues()

    Application.ScreenUpdating = False

       Sheets("Unique List").Columns(2).ClearContents
        Sheets("Data").Range("DR:DR").SpecialCells(xlCellTypeConstants).Copy
         Sheets("Unique List").Range("B1").PasteSpecial Paste:=xlPasteValues

    Application.CutCopyMode = False
    
         Sheets("Unique List").Range("B:B").RemoveDuplicates Columns:=2, Header:=xlYes

Application.ScreenUpdating = True

End Su

Open in new window

b
0
Comment
Question by:route217
  • 4
  • 2
6 Comments
 
LVL 25

Accepted Solution

by:
ProfessorJimJam earned 500 total points
ID: 41760862
Sub CopyandPasteValues()

    Application.ScreenUpdating = False

       Sheets("Unique List").Columns(2).ClearContents
        Sheets("Data").Range("DR:DR").SpecialCells(xlCellTypeConstants).Copy
         Sheets("Unique List").Range("B1").PasteSpecial Paste:=xlPasteValues

    Application.CutCopyMode = False
   
         Sheets("Unique List").Range("B:B").RemoveDuplicates Columns:=Array(2), Header:=xlYes
         
        LastRow = Range("B" & Rows.Count).End(xlUp).Row
         
Range("A2:A" & LastRow).Formula = "=IFERROR(OFFSET(Data!DR2,MATCH(B2,Data!$DR$2:$DR$1303,0),-83),"""")"
Application.ScreenUpdating = True

End Sub
0
 

Author Comment

by:route217
ID: 41760864
Hi Profjimjam...

U are back...excellent...let me test and as always appreciate the feedback.
0
 

Author Comment

by:route217
ID: 41760875
hi Profjimjam

getting a compile error variable not defined....when testing macro..
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

by:route217
ID: 41760877
Fixed it..
0
 
LVL 25

Expert Comment

by:ProfessorJimJam
ID: 41760892
you are welcome.

thanks for the feedback
0
 

Author Comment

by:route217
ID: 41762286
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question