Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Add extra step to current macro

Posted on 2016-08-18
6
Medium Priority
?
47 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 27

Accepted Solution

by:
ProfessorJimJam earned 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

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

Expert Comment

by:ProfessorJimJam
ID: 41760892
you are welcome.

thanks for the feedback
0
 

Author Comment

by:route217
ID: 41762286
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

885 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