training anthony regarding forma
RH

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Training with Anthony regarding Formating and importing and expo

Training with Anthony regarding Formating and importing and expo

resolvedResolved · Low Priority · Version 2007

Shamin has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course

Training with Anthony regarding Formating and importing and expo

Hi Anthony,

You were going to send me the solution for the problem I had with formating during the copying of the date column.

Also your were going to send me the code for importing and exporting CSV file.

Thank you.

Kind regards
Shamin Akhtar

RE: Training with Anthony regarding Formating and importing and

Hi Shamin, thanks for your queries. First of all, this line of code makes the value of h2 the same as a2:

Sheets("mysheet").Range("h2").Value = Sheets("mysheet").Range("a2").Value

...while this line of code makes the number format of h2 the same as a2:

Sheets("mysheet").Range("h2").NumberFormat = Sheets("mysheet").Range("a2").NumberFormat

So you might want to include that in your loops to ensure the integrity of your data.

Secondly, here's the line of code for exporting data as a CSV file:

ActiveWorkbook.SaveAs Filename:="E:\Desktop\SalesReport1.csv", FileFormat:= _
xlCSV, CreateBackup:=False

I hope this proves useful!

Anthony

RE: Training with Anthony regarding Formating and importing and

Hi Anthony,

Thank you for the quick response.

I will implement these codes.

Will I do similar step for importing CSV file?

Kind regards
Shamin

RE: Training with Anthony regarding Formating and importing and

Hi Shamin, yes the principle is the same for importing a CSV data file but you will have to record a macro yourself to get the specific code. The wizard will ask you for the delimiter and then to format the incoming data which will be a step specific to the data you are working on.

Let me know how you get on,

Anthony

RE: Training with Anthony regarding Formating and importing and

Hi,

Thank you.

Yes I will let you know.

Regards
Shamin

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

How To Find All Overdue Accounts?

To find overdue accounts create a filter that compares today's date with the Invoice Date in the table. To do this:

1. Open the Query in Design View
2. Select the field for the filter and in the criteria row enter:

<Date()

This filter returns records where the Invoice Date is before today's date.

This filter can be manipulated if, for instance, Invoices are due 15 days after the Invoice Date. For this the filter would be:

<Date()-15

This filter returns records where the Invoice Date is 15 days before today's date.

View all Access hints and tips


Server loaded in 0.05 secs.