unansweredExcel Macros VBA Coding - Need help on code

More
1 month 1 week ago #2862 by skumar
I am fairly new to excel macro though I have coded in VB+SQL long back. I give below my requirement and would like to write an Excel
VBA Macro.
  • Main file (Source File) having data (Data.xlxs)on multiple columns and rows and first column of each row will show the State Code. First Row from column 2 will be heading of the data. Prefer browse and select this file.
  • Need to extract data from the above file based on State Code (this will be received as User Input in the macro at the beginning) and we need to fetch those records pertaining to that state and transaction is less than (Today()-8)..
  •  Need only a few columns to be writteninto the new output file. Output File name to be derived as variable name and this file to be created within the macro. 
  • For example output fie name will be “PendingData Till “ + Today()-8 + “- For “ + State Code.xlxs”. This file to be created inside the Macro.
  • Would like to run this from a commonexcel file with only one Command Button to execute this macro multiple time on the same day for different State Code.
  • Would like to have normal commands aswell SQL commands for this macro. Hence request you to give 2 separate programs one with VBA file opening and getting data from Source File and writing data in output file. Also would like to use SQL commands to open file, to get and to write and close file records. 
 This is my requirement. If you have better approach/solution, please suggest.
 Need your immediate help. Please Provide me the code preferably with comments for my understanding.
 Please revert to me if you need any further info/clarification.
 Cheers/Kumar S
Email: Gmail
Mobile: +91 9941003699

Please Log in or Create an account to join the conversation.

Moderators: jaychivoExcelfansqiuhongkun