我借着这份工作手册,我正试图通过宏观法典开展工作。 我曾得到过一些援助,但似乎没有人了解我之后的情况。 这份工作手册用于跟踪和总结我们公司每个用户所收到工作服的数量。 因此,基本上,我在这份工作手册中翻了三张:。
- Summary
- Users
- Articles
一般想法是,我将从汇总表中的数据中得出一个可计算点。 但是,我希望该工作手册能够使用真.的法典。 因此,我穿过这里的每一页。
用户:这份工作手册仅包含一栏(A),A1称为“Name”,每行各有公司每个用户。
文章: 这份工作手册有两栏,A1是本条的名称(英文等),另一栏是该项目的价格。
概述:这是trick。 该表应反映其他两个表的数据,但我需要跟踪每个用户收到的每个项目的、。 我将这一数据保留在汇总表D栏。 因此,用户表中的每个名字都需要重复,因为文章中都有项目。 如果在条款表中有10项,则必须重复10次。 这样,我就可以说用户收到的每个项目有多少。
So, the tricky part is to actually mirror the content from the Users and Articles sheet, but still keep the data from column D in the summary sheet. Also keep in mind that if I remove a row from the Users sheet then that user needs to be removed completely from the Summary Sheet, including the amount of each item that was registered. And if I add an item to the Articles sheet, then that item needs to be added for each user in the Summary sheet.
我在那里看到了一些宏观法典,有些人帮助我,但我确实没有获得正在做的事情。 我不想随阵列和 lo而.。 这是我现在试图学习的,因为我看到学习这一潜力。
不过,我确实认为,我需要从所有表格中收集数据,储存所有数据。 然后,我需要将用户范围与《概述》范围进行比较,以了解用户是否在场。 如果是的话,确保更新《条款范围》的数据,并从哥伦德保留数据。 如不列入汇总表,则添加。 每个项目也是如此。
但是,如果我错了用户的型号,在我早就为用户增加数额之后,不会实现用户的字面? 如果我回到用户名册并重新命名用户,那么我是否会放松我以前增加的所有数据? 还是能够重新命名用户? 在该案中,我可能需要为每个用户提供某种身份识别,如Windows的CID? 这是否太高了? 这一切都是在时间上越好。 我真的赞赏这里的一些帮助:
Public Sub NewCollect()
Declare variables
Dim shtUsers, shtmyArticles, shtmySummary, shtmyAmount As Worksheet
Dim arrUsers, arrarticles, arramount, arrsummary As Long
Set worksheets
Set shtUsers = Sheets("Brukere")
Set shtArticles = Sheets("Artikler")
Set shtSummary = Sheets("Oppsummering")
Set shtAmount = Sheets("Antall")
Get range from shtUsers
With shtUsers
If Not .Range("A2") = "" Then
arrUsers = .Range("A2", .Cells(Rows.Count, "A").End(xlUp)).Resize(, 2)
End If
End With
Get range from shtArticles
With shtArticles
If Not .Range("A2") = "" Then
arrarticles = .Range("A2", .Cells(Rows.Count, "A").End(xlUp)).Resize(, 3)
End If
End With
Get range from shtAmount (The new sheet)
With shtAmount
If Not .Range("A2") = "" Then
arramount = .Range("A2", .Cells(Rows.Count, "A").End(xlUp)).Resize(, 2)
End If
End With
Get range from shtSummary
With shtSummary
If Not .Range("A2") = "" Then
Here I have no idea where to even begin
Else
If Summary sheet is blank, get data from other sheet and insert
ReDim tempArr(1 To UBound(arrUsers) * UBound(arrarticles), 1 To 6)
For u = 1 To UBound(arrUsers)
For i = 1 To UBound(arrarticles)
j = j + 1
tempArr(j, 1) = arrUsers(u, 1)
tempArr(j, 2) = arrUsers(u, 2)
tempArr(j, 3) = arrarticles(i, 1)
tempArr(j, 4) = arrarticles(i, 2)
tempArr(j, 6) = arrarticles(i, 3)
Next
Next
Add the data
.Range("A2").Resize(j, 6).Value = tempArr
End If
End With
Edit:我只给用户增加了一个新的栏目,而书目则为固定的身份证,我可以在每个项目中增加一个身份证。 更新了我天空司机的概况介绍。