macro excel
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and Help » Macro in Excel

Macro in Excel

The UK's most regular instructor-led training courses.
Training information: excel+course · Excel course london · VBA training in London

· Low Priority · Version Standard

Macro in Excel

Mike has attended:
No courses

by - delegate Mike [3 posts] (2008 Mar 12 Wed, 12:29) replyReply

I have a macro that copies data from one workbook and places it in another one. Until recently it was working fine now however it runs like it is working but never copies any data. The macro is designed to copy only unique data so if the document number is already in the new workbook it will not be copied(another issue for later) I have verified that since row 205 in the new WB the data in the original WB is unique yet the macro will not copy it. Can someone help me trouble shoot this issue or explain why it has stopped working/
Thanks

Excel Intermediate 1 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2007 2008 Jul 8 Tue Bloomsbury 0 FULL    
2003/XP 2008 Jul 8 Tue Bayswater 1 book now £195 £205
2003/XP 2008 Jul 9 Wed Bloomsbury 3 book now £210 £215
2003/XP 2008 Jul 15 Tue Bloomsbury 3 book now £210 £215
2003/XP 2008 Jul 15 Tue Tooting 0 FULL    
2007 2008 Jul 16 Wed Bloomsbury 7 book now £202 £224
Full Schedule: See all 160 Excel Intermediate course dates.
Bookings currently available until 25th November 2009.

RE: Macro in Excel

by - delegate Mike [3 posts] (2008 Mar 12 Wed, 21:11) replyReply

I have pasted the Macro code below that I am using. In the main spreadsheet data is entered manually Column 1 will be blank, have MIPR, 9L or Form36 in it. Column 2 has the document number (IE F3LNGA8067G001) the next few columns are a discription dates entered, the organization sent to, and current status. The Macro is designed to pull the data from each row where column 1 is equal to "MIPR" and place this data in the MIPR spreadsheet.

Sub importer()
Dim wrkbk As Workbook
Dim curbk As Workbook
Set curbk = ActiveWorkbook
Dim filt As String
Dim countervar
Dim offsetvar
offsetvar = WorksheetFunction.CountA(Range("A:A"))
countervar = 0
filt = InputBox("What filter do you want to use", "Filter", "MIPR")
Dim nm

nm = Application.Dialogs(xlDialogOpen).Show
If nm = True Then
Set wrkbk = ActiveWorkbook
nm = wrkbk.ActiveSheet.Range("b1").Value
While Len(nm) > 0
If InStr(wrkbk.ActiveSheet.Range("a1").Offset(countervar, 0).Value, filt) > 0 Then
If WorksheetFunction.CountIf(curbk.ActiveSheet.Range("B:B"), wrkbk.ActiveSheet.Range("b1").Offset(countervar, 0).Value) = 0 Then
curbk.ActiveSheet.Range("1:1").Offset(offsetvar, 0).Value = wrkbk.ActiveSheet.Range("1:1").Offset(countervar, 0).Value
offsetvar = offsetvar + 1
End If
End If
countervar = countervar + 1
nm = wrkbk.ActiveSheet.Range("b1").Offset(countervar, 0).Value
Wend
wrkbk.Close False
End If

End Sub


Related articles

· 3 Ways that MS Excel Courses Can Drastically Improve Productivity for Teachers
· Microsoft Excel Courses Teach Advanced Macro Techniques
· Basic Excel Training
· Tap the Power of Recorded Macros with MS Excel Courses
· Microsoft Excel Cheat Sheet: Tips and Shortcuts

Please browse our web site to find out more about
excel+course and other Microsoft training courses.

Excel tip:

Removing custom dictionary entries

If you add something to the custom dictionary in Excel you cannot remove it. The way to get around this is to go into word and remove it there.

View all Excel hints and tips

Institute of IT Training - Accredited Training Provider Institute of IT Training - Accredited Training Provider Prodigy Platinum Learning Partner Microsoft Office Specialist Authorised Testing Centre

Microsoft Registered Partner
microsoft office
ms office project server

Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information
AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz