VBA-Calling Data from a variable the pasting

JediJim

New Member
Joined
Jul 27, 2011
Messages
10
Guys-This is racking my brain.

I've created a variable as a string. I need to use this data to be past into another cell into another worksheet: Please advise:

Dim vOurResult As String
Dim myportfolio1 As String
Dim Found As Boolean
myportfolio = Sheets("Trade Breakdown").Range("A9").Text
If WorksheetFunction.CountIf(Sheets("MO Trade List").Range("A2:A15"), "TCPAM Investments (Cayman) Limited - Class F Fund") > 0 Then
With Sheets("MO Trade List").Range("A2:A15")
Found_Data = 0
Found = False
vOurResult = .Find(What:="TCPAM Investments (Cayman) Limited - MENA Equity Fund", AFTER:=.Cells(1, 1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Offset(0, 3)



vOurResult1 = .Find(What:="TCPAM Investments (Cayman) Limited - MENA Equity Fund", AFTER:=.Cells(1, 1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Offset(0, 9)

vOurResult2 = .Find(What:="TCPAM Investments (Cayman) Limited - MENA Equity Fund", AFTER:=.Cells(1, 1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Offset(0, 11)


End With
MsgBox Portfolio & myportfolio1 & vbNewLine & "Fund" & vOurResult & vbNewLine & "Shares" & vOurResult1 & vbNewLine & "USD Amount" & vOurResult2

End If

.......Here is selecting the data from the variable and pasting it into the named cell....
Sheets("Trade Breakdown").Activate
Range("A11").Select
If vOurResult = "" Then
MsgBox "Found"


Thanks in advance,

JediJim
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Guys-any assistance is appreciated.

Just calling a variable and using that data in another worksheet?.


Thanks

JJ
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,848
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top