Exporting files to specific sheet of different excell file

Luka_LB

Board Regular
Joined
Nov 14, 2011
Messages
51
hi allyour help is needed again :)I have excel file which makes a report with vba,after report is done I copy reported data to another excell file sheet, if date of operations in report is march 15 I put it in sheet called 0315, if June 5 - in 0605 and so and so.'my question is if it's possible VBA to ask me what date report i'm making and according to it to paste reported data in a different excell file's exact sheet.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
1. click on the Sheet1 tab then select View Code
2. paste this code
Code:
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim var As String
    If Target.Address = "$A$1" Then var = InputBox("Enter date:")
End Sub

3. this refers to cell A1 - so if you click A1 it will ask for the input/date ( string datatype, so write your own code to handle stream errors )
4. users input is stored in variable called 'var'
 
Upvote 0
an elegant form would be a userform with 2 comboboxes for the day and the month then using those values to search through the other workbook if the sheet exist and paste the data.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top