2014-06-16 217 views
-1

我想從一個頁面拉多個值,並使這些值覆蓋其他頁面上的值,如果按下按鈕。多頁面覆蓋更新

Private Sub CommandButton1_Click() 

Dim MemberP As String, RangeUserP As String, BuyerP As String 
Dim CCP As String, SMP As String, FMP As String 
Dim MemberGP As String, GunNumb As String 

Worksheets("TreeMap").Select 
MemberP = Range("Z16") 
RangeUserP = Range("R28") 
BuyerP = Range("I28") 
CCP = Range("Z24") 
FMP = Range("AA24") 
SMP = Range("AB24") 
MemberGP = Range("R41") 
GunNumb = Range("G43") 

//Part 1 

Worksheets("Membership Model").Select 
Range("R11").Value = MemberP 
Range("C10") = CCP 
Range("H10") = FMP 
Range("L10") = SMP 
Worksheets("S1- Buyers RangeUsers").Select 
Range("B6") = RangeUserP 
Range("B7") = BuyerP 
Worksheets("S2- Range Users Splits").Select 
Range("J11") = MemberGP 
Worksheets("S4- Selling Points").Select 
Range("K6") = GunNumb 
MsgBox ("Updated") 

//Part 2 

End Sub 

的MSGBOX工作。

第1部分是輸入位置,第2部分是輸出位置。

回答

0

This Works ... Somehow。

私人小組CommandButton1_Click()

昏暗MemberP作爲字符串,RangeUserP作爲字符串,BuyerP作爲字符串,CCP作爲字符串,SMP作爲字符串,FMP作爲字符串,MemberGP作爲字符串,GunNumb作爲字符串

Worksheets("TreeMap").Select 
MemberP = Range("Z16") 
RangeUserP = Range("R28") 
BuyerP = Range("I28") 
CCP = Range("Z24") 
FMP = Range("AA24") 
SMP = Range("AB24") 
MemberGP = Range("R41") 
GunNumb = Range("G43") 

Worksheets("Membership Model").Range("R11").Value = MemberP 
Worksheets("Membership Model").Range("C10").Value = CCP 
Worksheets("Membership Model").Range("H10").Value = FMP 
Worksheets("Membership Model").Range("L10").Value = SMP 

Worksheets("S1- Buyers RangeUsers").Range("B6").Value = RangeUserP 
Worksheets("S1- Buyers RangeUsers").Range("B7").Value = BuyerP 

Worksheets("S2- Range Users Splits").Range("J11").Value = MemberGP 

Worksheets("S4- Selling Points").Range("K6").Value = GunNumb 

MsgBox ("Updated") 

End Sub