macro to copy Bold value

Tintoo

New Member
Joined
Oct 9, 2015
Messages
27
Pls help me... since am not aware of macros and now i need to complete my work faster.

lets say i have a any content (text or numbers) in range A1:H10000 in sheet 1. There is only one "BOLD" value in sheet 1. I need to copy that bold value and paste in sheet 2 of same workbook in column E. It should copy and paste in column E of sheet 2 only if there is any content in the corresponding cell in the previous column D of sheet 2. if there is no content in column D then it should not paste in column E and it should be blank or empty. I dont want to retain the format.

Thanks in advance
 
Rick Rothstein,

Yeah its the same setup only. and i want same thing as u mentioned only...

I cannot duplicate that result... the code I posted in Message #8 works fine for me. I just noticed that you told us two different things in Messages #1 and #4... my code assumes the data is in Sheet1 in the range A1:H100 and the output is to go to Sheet10 range E1:E10 but only for those cells where a value is in range D1:D10 on Sheet10... is that the same as your current setup?
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Rick Rothstein,

Yeah its the same setup only. and i want same thing as u mentioned only...
Well, as I said, the code works for me and I cannot duplicate what you are reporting. Any chance you can send me a copy of the workbook where my code doesn't work so that I can debug my code "live" against your actual data? My email address is...

rick DOT news AT Verizon DOT net

If you do send it to me, please include the thread title in your message so that I can more easily find my way back to this thread when I am done.
 
Upvote 0
Rick Rothstein,

I have mailed you my file.. please check out and help me...
:)
I received it. The problem appears to be the sheet names.... you told me they were Sheet1 and Sheet10, but in the file you sent me, they are "Total Sales" and "New occurrence data". Once I changed my code to account for this, the macro appeared to work fine to me, but of course you will have to check it out for yourself. Here is the modified macro for you to try...
Code:
[table="width: 500"]
[tr]
	[td]Sub CopyBoldValueToSheet10RangeE1ToE10()
  Dim CellVal As Variant
  Application.FindFormat.Clear
  Application.FindFormat.Font.Bold = True
  On Error GoTo NoBoldText
  CellVal = Sheets("Total Sales").Range("A1:H100").Find("", SearchFormat:=True).Value
  Sheets("New occurrence data").Range("E1:E10").Value = Evaluate("IF('New occurrence data'!D1:D10="""","""",""" & CellVal & """)")
  Application.FindFormat.Clear
NoBoldText:
End Sub[/td]
[/tr]
[/table]
 
Upvote 0
Rick Rothstein,

Thanks you so much Rick:).. It works perfect now...

I received it. The problem appears to be the sheet names.... you told me they were Sheet1 and Sheet10, but in the file you sent me, they are "Total Sales" and "New occurrence data". Once I changed my code to account for this, the macro appeared to work fine to me, but of course you will have to check it out for yourself. Here is the modified macro for you to try...
Code:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sub CopyBoldValueToSheet10RangeE1ToE10()
  Dim CellVal As Variant
  Application.FindFormat.Clear
  Application.FindFormat.Font.Bold = True
  On Error GoTo NoBoldText
  CellVal = Sheets("Total Sales").Range("A1:H100").Find("", SearchFormat:=True).Value
  Sheets("New occurrence data").Range("E1:E10").Value = Evaluate("IF('New occurrence data'!D1:D10="""","""",""" & CellVal & """)")
  Application.FindFormat.Clear
NoBoldText:
End Sub[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,216,747
Messages
6,132,486
Members
449,729
Latest member
davelevnt

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