Home > Software engineering >  VBA small white turn to god, thank you
VBA small white turn to god, thank you

Time:09-15

VBA small white turn to god, thank you; According to the information in column E, by VBA language, setting up a button, the first column C automatic out of the corresponding information;





[/img]

CodePudding user response:

Code:
 Option Explicit 

Public Sub ShowData ()
Dim dctData As Object
The Set dctData=https://bbs.csdn.net/topics/CreateObject (" scripting. The dictionary ")

Dim As Integer I
I=10

'read the corresponding relation between objects in the dictionary.
The Do While True
If the Range (" K "& amp; I)="" Then
The Exit Do
The Else
DctData. Add CStr (Range (" K "& amp; I)), the CStr (Range (" L "& amp; I))
End the If

I=I + 1
Loop

'data to fill into the column, pay attention to deal with merge cells.
For I=1 To 100
Dim strKey As String
StrKey=Range (" E "& amp; I). MergeArea. Cells (1, 1)

If dctData. The exists (strKey) Then
Range (" C "& amp; (I)=dctData strKey)
End the If
Next

End Sub

Presentation:

Download address:
Link: https://pan.baidu.com/s/1QPA7xKtGeDcAnCm3KGoniw
The extracted code: 0 k0f

CodePudding user response:

reference 1st floor milaoshu1020 response:
code:
 Option Explicit 

Public Sub ShowData ()
Dim dctData As Object
The Set dctData=https://bbs.csdn.net/topics/CreateObject (" scripting. The dictionary ")

Dim As Integer I
I=10

'read the corresponding relation between objects in the dictionary.
The Do While True
If the Range (" K "& amp; I)="" Then
The Exit Do
The Else
DctData. Add CStr (Range (" K "& amp; I)), the CStr (Range (" L "& amp; I))
End the If

I=I + 1
Loop

'data to fill into the column, pay attention to deal with merge cells.
For I=1 To 100
Dim strKey As String
StrKey=Range (" E "& amp; I). MergeArea. Cells (1, 1)

If dctData. The exists (strKey) Then
Range (" C "& amp; (I)=dctData strKey)
End the If
Next

End Sub

Presentation:

Download address:
Link: https://pan.baidu.com/s/1QPA7xKtGeDcAnCm3KGoniw
Extract code: 0 k0f

Thank you for the great god, is so good!!!!!

CodePudding user response:

reference 1st floor milaoshu1020 response:
code:
 Option Explicit 

Public Sub ShowData ()
Dim dctData As Object
The Set dctData=https://bbs.csdn.net/topics/CreateObject (" scripting. The dictionary ")

Dim As Integer I
I=10

'read the corresponding relation between objects in the dictionary.
The Do While True
If the Range (" K "& amp; I)="" Then
The Exit Do
The Else
DctData. Add CStr (Range (" K "& amp; I)), the CStr (Range (" L "& amp; I))
End the If

I=I + 1
Loop

'data to fill into the column, pay attention to deal with merge cells.
For I=1 To 100
Dim strKey As String
StrKey=Range (" E "& amp; I). MergeArea. Cells (1, 1)

If dctData. The exists (strKey) Then
Range (" C "& amp; (I)=dctData strKey)
End the If
Next

End Sub

Presentation:

Download address:
Link: https://pan.baidu.com/s/1QPA7xKtGeDcAnCm3KGoniw
Extract code: 0 k0f

A great god, and you can leave a contact way, want to consult with some small problem, thank you.

CodePudding user response:

reference 1st floor milaoshu1020 response:
code:
 Option Explicit 

Public Sub ShowData ()
Dim dctData As Object
The Set dctData=https://bbs.csdn.net/topics/CreateObject (" scripting. The dictionary ")

Dim As Integer I
I=10

'read the corresponding relation between objects in the dictionary.
The Do While True
If the Range (" K "& amp; I)="" Then
The Exit Do
The Else
DctData. Add CStr (Range (" K "& amp; I)), the CStr (Range (" L "& amp; I))
End the If

I=I + 1
Loop

'data to fill into the column, pay attention to deal with merge cells.
For I=1 To 100
Dim strKey As String
StrKey=Range (" E "& amp; I). MergeArea. Cells (1, 1)

If dctData. The exists (strKey) Then
Range (" C "& amp; (I)=dctData strKey)
End the If
Next

End Sub

Presentation:

Download address:
Link: https://pan.baidu.com/s/1QPA7xKtGeDcAnCm3KGoniw
Extract code: 0 k0f

A great god, and there is a small problem to separate communication, would you please give a contact, urgent need, thank you very much!

CodePudding user response:

[email protected]

Asked what's the problem here is not good.

CodePudding user response:


Prompt reply thank milaoshu1020 great spirit, in the morning, with the great god provide code is very nice, thank you,

There is a small problem, it should be not clearly stated before, specific please see picture.


CodePudding user response:

Change is good, code:
 
Option Explicit

Public Sub ShowData ()
Dim dctData As Object
The Set dctData=https://bbs.csdn.net/topics/CreateObject (" scripting. The dictionary ")

Dim As Integer I
I=10

'read the corresponding relation between objects in the dictionary.
The Do While True
If Worksheets. (2) Range (" K "& amp; I)="" Then
The Exit Do
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • VBA
  • Related