Dupliate Text Exactly

HJay

New Member
Joined
Nov 30, 2007
Messages
31
Hi

Does anyone know if it is possible to type text into a cell on sheet 1 and it be reproduced in another cell on sheet 2 and keep the formatting. i.e. the first word is in bold and then the following 10 words are not bold.

I have managed to duplicate the text but not the formatting using ='Sheet One'!A1 but I can not get the formatting to stay the same.

Any help greatly appreciated :)
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Sheet1 B15 represents the Cell that you type into
Sheet2 A1 is the Cell that gets copied into.

You would put this code into the VBA for Sheet1


Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim mycell As Range
Application.EnableEvents = False
    If Not Intersect(Target, Range("B15")) Is Nothing Then
        Sheets("Sheet1").Range("B15").Copy Destination:=Sheets("Sheet2").Range("A1")
    End If
Application.EnableEvents = True
End Sub
 
Upvote 0
Many thanks for your response, where would I put the code? I have never used VBA before. Be gentle :)
 
Upvote 0
It's really easy. Right click on the Tab at the bottom and go to View Code. Paste it there
 
Upvote 0
Many thanks for your reply.

I have right clicked on the sheet1 tab.

Clicked View Code.

Pasted the text in the open window

Closed that window and then the other window that takes me back to the excel sheet

I type something in B15 in Sheet1

Then go and look at A1 in Sheet2 but there is nothing there.

What have I done wrong? Do I have to press something to make it happen?

Many thanks :)
 
Upvote 0
Are sheet1 and sheet2 named sheet1 and sheet2?

It has to be exact or it won't work, if there is a space it will not work.
 
Upvote 0
Try this... Right click on a Tab. Go to View Code. on the left side Right click on one of the sheets. go to insert and Module. Paste the below code

Code:
Sub Test()
Application.EnableEvents = True
End Sub

Then try to enter something in Sheet1!B15

If that doesn't work, then try opening the sheet1 code again and paste the code below. Honestly I'm not sure why it isn't working for you, so I'm trying any possible solution.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim mycell As Range
Application.EnableEvents = False
    If Not Intersect(Target, Range("B15")) Is Nothing Then
        Sheets(1).Range("B15").Copy Destination:=Sheets(2).Range("A1")
    End If
Application.EnableEvents = True
End Sub
 
Last edited:
Upvote 0
Are sheet1 and sheet2 named sheet1 and sheet2?

It has to be exact or it won't work, if there is a space it will not work.
If the Sheet names were issues it would throw an error. Instead you are likely looking at a case where the Application.enableevents setting is already set to false, or the macro security settings are disabling the use of macros.

Start by trying to run this code and then see if you can make a change to B15 of sheet 1 and see if sheet2 is updated.
Code:
Sub EnableCalcScreenUpdate()

Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Hi Redwolfx

Still no joy :(

Thank you for your persistence. Am sure that I am doing something daft!
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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