if msgbox no then Popup checkbox with multiple selections

liwi2

New Member
Joined
Apr 14, 2014
Messages
26
Hi All,
I am stuck on that one and hope someone will be able to help me out here.
I have 2 workbooks
- "sourcewks" - list of employees in col A
- "destwks" - list of jobs where employees are assigned ( either 2 or 3 employees in col B,C or D every 9 rows starting from 10th). Below is sample table of 2 first jobs out of 12

ABCD
1
2
3Job1
4
5
6
7
8
9
10Employee
11
12Job2
13
14
15
16
17
18
19Employee

<tbody>
</tbody>


I have already the part where if option of 2 employees is selected and now I need popup checkbox "UserForm1" for user to select which job out of 12 they want to assign 3 employees to. I have already created the checkbox but no idea what next
Once these jobs are selected I need code to paste 3 employees in these jobs and in all others 2 employees.
Here is part of my code:

....
answer = MsgBox("Do you want to use 2 people for all jobs?", vbYesNo + vbQuestion)
If answer = vbYes Then
lngRowCounter = 1
n = 10
sourcewks.Activate
Do While helpwks.Cells(lngRowCounter, 1).Value <> ""
sourcewks.Range("A" & lngRowCounter).Copy
destwks.Range("B" & n).PasteSpecial Transpose:=True
lngRowCounter = lngRowCounter2 + 1
sourcewks.Range("A" & lngRowCounter).Copy
destwks.Range.Range("C" & n).PasteSpecial Transpose:=True
lngRowCounter = lngRowCounter + 1
n = n + 9
Loop


Else


UserForm1.Show


...

I can't figure out how to do it or find anything online.
I will be grateful for your help.

Many thanks in advance
 

Forum statistics

Threads
1,082,040
Messages
5,362,804
Members
400,693
Latest member
jenlj

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top