如果这已成问题,请提前道歉。
我已经开发了一个用户表单来自动填充我们发送给利益相关者的一些信件。我目前在userform中有一个地址部分 - textboxstreet textboxsuburb等。 User form
在某些情况下我需要:
Address A - the address we are sending the letter to
and
Address B - the address we sent the letter to previously
例如:
John Smith
15 Madeup Street
Faketown Australia
这是一封跟进信,建议我们将您之前的信件发送到33 Faking Place Nowhere Australia。
我的结论是,我显然需要一个地址A部分和一个地址B部分来打破地址。有没有办法 - 如果地址a和地址b相同,那地址填充在为地址B设置的书签中?
例如:
如果地址'不同:
(bookmarkaddressA) = textboxaddressA
(bookmarkaddressB) = textboxaddressB
如果地址'相同:
(bookmarkaddressA) = textboxaddressA
(bookmarkaddressB) = textboxaddressA
理想情况下,我希望它的功能类似于 “邮政地址和居住地址一样吗?”复选框 - 只是灰显/锁定textboxaddressb并填写textboxaddressa
中的信息欢迎任何建议。
完整代码:
Option Explicit
Private Sub CheckBox1_Click()
If (CheckBox1.Value = True) Then TextBoxStreet2 = TextBoxStreet
If (CheckBox1.Value = True) Then TextBoxSuburb2 = TextBoxSuburb
If (CheckBox1.Value = True) Then TextBoxPostcode2 = TextBoxpostcode
If (CheckBox1.Value = True) Then ComboBoxState2 = ComboBoxState
If (CheckBox1.Value = False) Then TextBoxStreet2 = Null
If (CheckBox1.Value = False) Then TextBoxSuburb2 = Null
If (CheckBox1.Value = False) Then TextBoxPostcode2 = Null
If (CheckBox1.Value = False) Then ComboBoxState2 = Null
End Sub
Private Sub ComboBoxTitle_Change()
End Sub
Private Sub CommandButtonCancel_Click()
Unload Me
End Sub
Private Sub CommandButtonClear_Click()
TextBoxFN.Value = Null
TextBoxGN.Value = Null
ComboBoxState.Value = Null
ComboBoxTitle.Value = Null
TextBoxStreet.Value = Null
TextBoxSuburb.Value = Null
TextBoxpostcode.Value = Null
TextBoxCD.Value = Null
TextboxMPN.Value = Null
TextBoxMPDD.Value = Null
TextBoxNPN.Value = Null
TextBoxNPDD.Value = Null
ComboBoxState2.Value = Null
TextBoxStreet2.Value = Null
TextBoxSuburb2.Value = Null
TextBoxPostcode2.Value = Null
CheckBox1.Value = False
End Sub
Private Sub CommandButtonOk_Click()
Application.ScreenUpdating = False
With ActiveDocument
.Bookmarks("Title").Range.Text = ComboBoxTitle.Value
.Bookmarks("GN").Range.Text = TextBoxGN.Value
.Bookmarks("FN").Range.Text = TextBoxFN.Value
.Bookmarks("FN2").Range.Text = TextBoxFN.Value
.Bookmarks("Street").Range.Text = TextBoxStreet.Value
.Bookmarks("Suburb").Range.Text = TextBoxSuburb.Value
.Bookmarks("State").Range.Text = ComboBoxState.Value
.Bookmarks("PostCode").Range.Text = TextBoxpostcode.Value
.Bookmarks("Street2").Range.Text = TextBoxStreet2.Value
.Bookmarks("Suburb2").Range.Text = TextBoxSuburb2.Value
.Bookmarks("State2").Range.Text = ComboBoxState2.Value
.Bookmarks("PostCode2").Range.Text = TextBoxPostcode2.Value
.Bookmarks("CD").Range.Text = TextBoxCD.Value
.Bookmarks("MPN").Range.Text = TextboxMPN.Value
.Bookmarks("MPN2").Range.Text = TextboxMPN.Value
.Bookmarks("MPN3").Range.Text = TextboxMPN.Value
.Bookmarks("MPN4").Range.Text = TextboxMPN.Value
.Bookmarks("MPN5").Range.Text = TextboxMPN.Value
.Bookmarks("MPDD").Range.Text = TextBoxMPDD.Value
.Bookmarks("NPN").Range.Text = TextBoxNPN.Value
.Bookmarks("NPDD").Range.Text = TextBoxNPDD.Value
End With
Application.ScreenUpdating = True
Unload Me
End Sub
Private Sub UserForm_Initialize()
With ComboBoxState
.AddItem "QLD"
.AddItem "NSW"
.AddItem "ACT"
.AddItem "VIC"
.AddItem "TAS"
.AddItem "SA"
.AddItem "WA"
.AddItem "NT"
End With
With ComboBoxTitle
.AddItem "Mr"
.AddItem "Mrs"
.AddItem "Miss"
.AddItem "Ms"
End With
lbl_Exit:
Exit Sub
End Sub
Private Sub TextBoxMPN_Change()
TextboxMPN = UCase(TextboxMPN)
End Sub
Private Sub TextBoxNPN_Change()
TextBoxNPN = UCase(TextBoxNPN)
End Sub
Private Sub TextBoxFN_Change()
TextBoxFN = UCase(TextBoxFN)
End Sub
答案 0 :(得分:1)
既然你问过,这就是我可能做过的事情(为清楚起见,未包含一些代码):
def load_data_from_gcs(dataset_name, table_name, source):
bigquery_client = bigquery.Client()
dataset = bigquery_client.dataset(dataset_name)
table = dataset.table(table_name)
job_name = str(uuid.uuid4())
job = bigquery_client.load_table_from_storage(
job_name, table, source)
job.source_format = 'NEWLINE_DELIMITED_JSON'
job.begin()
wait_for_job(job)
print('Loaded {} rows into {}:{}.'.format(
job.output_rows, dataset_name, table_name))