views:

558

answers:

1

Hi,

Please help me in writing the Macro.I have no idea writing VB Macro and its SyntaX.

The scenario is: An excel document has two sheets.The first sheet contains the marks,grades and project details of students. The second sheet contains the dropdown lists of Project version number, different Company names, and post.

Project version number dropdown list includes - 1, 2, 3, 4, 5, 6, 7, INVALID Company names includes: AIB Limited, RIS Limited and so on in the dropdown list Post list includes: Programmer, Tester, Technical support

What we want is:

  1. On selecting the Version (1,2,3,4,5,6,7) from project version No.(B5) of sheet2,the number selected must appear under "selected version" column(D5,sheet2).

  2. if one selects the version as INVALID, then a text box should appear in D5 column(sheet2) allowing the user to enter any value for "project version".

  3. And the same value that had appeared in D5 should also get copied to the "project version" column (H5) of sheet2

NOTE: Similar steps need to be implemented for company name(D9) or post(D13) list of sheet2.

For further understanding of the scenario, the problem statement is given in the form of a algorithm:

do select the Project version number(sheet2 dropdown list)

if priority is "invalid"

{

Create a text box in "selected version" field(D5,sheet2).
Allow the user to enter invalid value in "selected version" field(D5,sheet2).
}

else

{

copy the respective Project version number to the "selected version" field of   the same sheet (D5,sheet2).

}

copy the Project "selected version" field to Sheet1(H5 and E13)

end

do select the Company name(sheet2)

{

copy the respective Company name to the "Recruited for" field of the same sheet (D9,sheet2).

}

copy the Project " Recruited for" field to Sheet1(F9)

end

do select the Post(sheet2)

{

copy the respective Company name to the " Post " field of the same sheet (D13,sheet2).

}

copy the Project " Post " field to Sheet1(G9)

end

A: 

Hello,

Please help me in writing Macro.I wanto to write a Macro for copying a particular value from a dropdown list into a next column.

For example: If I select "1" (from the dropdown list) then paste "1" to next column(same row) , If I select "2" (from the dropdown list) paste "2" to next column(same row) on deleting the previously selected option (i.e, "1")

Thanks