PDA

View Full Version : VBA project help



hannn
12-07-2013, 07:15 PM
Part 1
You receive data in a file that contains dates in the following format:
YYYYMMDD Sample: 20100101
a) Write a function that will convert the date to date format: MM/DD/YYYY

b) Call this function "DateConverter", with one pass-through variable called "dtYYYYMMDD".

Part 2
Write a process that uses For... Next loops and an array to fill range B3:D10 of the Part2 worksheet.
a) To create the array, use the following code:
Public strCellRefs(1 To 8, 1 To 3) As String
b) Fill the array with the following text:
Row:(row reference);Column:(column reference)
strCellrefs(1,1) would contain the text: "Row: 3; Column: 2"
strCellrefs(8,3) would contain the text: "Row: 10; Column:4".
Again, fill this array using For... Next
c) Using a single command, paste the entire array into the cells B3:D10 on the worksheet "Part2"

SamT
12-07-2013, 10:54 PM
Got some homework, huh?

Please read the FAQ and :rtfm:for the words "Left," "Mid," Right," Format," "DateFormat," and the underlined words in the assignment.

The easiest way to get help on any key word in VBA is to place the cursor inside the word and press F1.

mrojas
12-08-2013, 01:51 PM
Attach a file with the code so far you've written so we can be of more help.