VBA Insert Formula and Find Text

unknownymous

Board Regular
Joined
Sep 19, 2017
Messages
249
Office Version
  1. 2016
Platform
  1. Windows
Hi Guys,

Can someone help me how to simplify this code?

Sub Macro2()
ActiveCell.FormulaR1C1 = "=RC[3]&R1C2&R[1]C[3]"
Selection.Copy
Range("A2").Select
Selection.End(xlDown).Select
Range("B1596").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.End(xlUp).Select
End Sub

--------------------------------------------------------------------------
In cell B1, there's a space which I use in formula. In B2, I will put a formula combining E2&E3 so I have this formula in B2=E3&$B1$&E3 which I need to drag the formula up to the last non blank cell and hardcode it

Also, I need to look for the word "DONE" in column C and if the value exist additional row will be created after it.

Any help will be much appreciated.


Thanks!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
How about
Code:
Sub Unknownymous()
   With Range("B2", Range("A" & Rows.Count).End(xlUp).Offset(, 1))
      .FormulaR1C1 = "=rc[3]&"" ""&r[1]c[3]"
      .Value = .Value
   End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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