Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Report creation through VBA macro help required!

  Asked By: Rodolfo    Date: Dec 11    Category: MS Office    Views: 920
  

Iam very new to Macro and VBA & I have to create a report macro
however I tried hard but no help...
please suggest how to create the report using VBA macro I will
explain the scenario below..

In a excel work book there are 4 sheets called 1,2,comp,report..


Sheet1 sample data

col1_id col2 col3 col4 col5
id_1 2.3 0 32 56
id_2 0 0 33 72
id_3 2829.0 0 34 58
id_4 2.3 0 35 59


sheet2 sample data

col1_id col2 col3 col4 col5
id_11 0 0 80 71
id_12 0 1 81 72
id_13 0 82 73
id_14 0 83 74

Comp sheet
col1_id col2 col3 col4 col5
FALSE FALSE TRUE TRUE FALSE
FALSE TRUE FALSE FALSE TRUE
FALSE FALSE TRUE TRUE FALSE
FALSE FALSE TRUE TRUE FALSE

Report sheet

col2 col5
Id _1 value_1 value_2 value_1 value_2
col3 col4
Id _2 value_1 value_2 value_1 value_2



Basically sheet 1 & sheet 2 contain the data which is compared in
compsheet (3rd sheet ) which shows true and False where there is a
match and mismatch respectivly ..


and after that a report macro is to created which will

1.search the comp sheet range cells
2.ignore the 1st column false value
3. after that whereever the macro finds the FALSE value, it will
record the cell reference value like cell(1,2)
4. go to sheet 1 and sheet 2 and report the value present at the
cell reference location recorded in step 3 to sheet 4 along with the
corresonding value of col 1
5. and this process keep on repeating till all the cells of the sheet
3 comp sheet are navigated .
6. the values in the report sheet will be populated in the next
available blank value in the format as shown .

for example in the sheet 3 cell (1,2) is false

col1_id col2 col3 col4 col5
FALSE FALSE TRUE TRUE FALSE


so the macro will return something like shown below



sheet 4

col2 col5
Id _1 value_1 value_2 value_1 value_2


value 1 and value 2 are the values at the cell (1,2) where it was
false in sheet 3 and the id-1 is corresponding value in col 1 ...

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Report creation through VBA macro help required! Or get search suggestion and latest updates.




Tagged: