Hello, little correction in VBA

Meko1

New Member
Joined
Oct 20, 2020
Messages
44
Office Version
  1. 2016
Platform
  1. Windows
Hello
Please help me out in this small matter.
My code is following:

ActiveSheet.Range("B6") = Sheet10.Range.Text("B2") & (" C2")

So I want from sheet10 to get B2 and C2 cell data in my active sheet B6 cell. But as it seems Right side of the code leaks something.
Since B2 and C2 are name and surname I want them to be like text, Lets say B2-John, C2-Smith and B6 to read John Smith.

Thanks in advance
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
When you say My code.
I assume you want a Vba solution


Try this:
VBA Code:
Sub My_Script()
'Modified 12/6/2020  5:39:45 AM  EST
ActiveSheet.Range("B6").Value = Sheets(10).Range("B2") & " " & Sheets(10).Range(" C2")
End Sub
 
Upvote 0
Solution
I would guess you may want more then this:
If you want help making this script do more let me know
Like maybe you want this to keep going down from B6 to B7 and B8 and more
 
Upvote 0
I would guess you may want more then this:
If you want help making this script do more let me know
Like maybe you want this to keep going down from B6 to B7 and B8 and more
Thank you, I am new to the VBA, coding and I am learning it step by step, trying different options... If I have other difficulties I would let you know for sure.
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,729
Members
449,049
Latest member
MiguekHeka

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