Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 10-29-2015, 12:43 PM
macropod's Avatar
macropod macropod is online now Extract data based on pattern with respect to specific column Windows 7 64bit Extract data based on pattern with respect to specific column Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by PRA007 View Post
Actually I wanted to automate few things using vbscript.
...
This code further runs macro solution given by you above.
You hadn't previously mentioned wanting to automate in this way. Even so, that code won't run the macro I posted, since it tries to use a workbook named 'Fees.xlsm' and your attachment workbooks were named 'Main.xlsx' and 'Database2.xlsx'.

Furthermore, in post #7 you have:
Code:
Set wkb = Workbooks.Open("C:\Users\rahulkumar.patel\Desktop\Sheet1.xlsx")
Set wkb1 = Workbooks.Open("C:\Users\rahulkumar.patel\Desktop\FE.xlsx")
Set xlShtTgt = Workbooks("Sheet1.xlsx").Sheets(1)
Set xlShtSrc = Workbooks("FE.xlsx").Sheets(1)
Aside from the fact that could could be reduced to:
Code:
Set wkb = Workbooks.Open("C:\Users\rahulkumar.patel\Desktop\Sheet1.xlsx")
Set wkb1 = Workbooks.Open("C:\Users\rahulkumar.patel\Desktop\FE.xlsx")
Set xlShtTgt = wkb .Sheets(1)
Set xlShtSrc = wkb 1.Sheets(1)
this code doesn't do any of the checking to see if either workbook is already open. As I said in post #8, I've already given you code showing how to do that. If you don't do such checks, you risk having your macro crash.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
excel vba, excel vba xml import loop



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract data based on pattern with respect to specific column Extract Data From Text file based on Pattern PRA007 Word VBA 13 11-01-2015 11:20 PM
Powerpoint show specific data based on selection Christov PowerPoint 1 05-14-2015 09:35 PM
Extract data based on pattern with respect to specific column How to Extract Data from table based on pattern. PRA007 Word Tables 4 03-17-2015 11:05 PM
Extract data based on pattern with respect to specific column Excel VBA Macro - Deleting Specific Data based on criteria MD011 Excel Programming 3 12-10-2014 02:15 AM
Mouseover cell to indicate mouse pointer location based on Specific Row/Column values bolandk Excel 1 05-15-2014 08:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft