Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 09-21-2018, 07:27 AM
rsrasc rsrasc is offline Concatenate Macro VBA Windows 10 Concatenate Macro VBA Office 2013
Competent Performer
Concatenate Macro VBA
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

Quote:
Originally Posted by Pecoflyer View Post
You don't really need a macro for this Just group the sheets ( while holding down the Shift key select the first and the last sheet tab)
Enter the formula in the first sheet
Automatically all other sheets will have the formula in the same position
Record a macro to automate the process if required

I agree that I don't need a macro to accomplish this.

Seems to be really easy.

My intention is to be able to do it with a macro. That way I would like to be able to automate what I'm trying to do. The main purpose is that I can combine it with other macros and run it automatically.


I have tried the below code but does not work so I'm getting a Run-time error "1004". Application-define or object-defined error.

If someone can help me with this, I will appreciate it.


Will keep trying...


Code:
Sub Main()
  Dim ws As Worksheet, c As Long, s$
  For Each ws In Worksheets
    With ws
      c = .Cells(.Rows.Count, "B").End(xlUp).Row
      s = "=NF" & "-" & "A1" & Left(B10, 5) & "-" & Mid(B10, 7, 45) & "--Budget 2019"
      'Debug.Print s
      .Range("A10").Formula = s
      .Range("A10").Copy .Range(.Range("A10"), .Cells(c, "A"))
    End With
  Next ws
End Sub

Thanks all.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate Macro VBA RIGHT Function With Concatenate (?) VBA-Need Help with Macro rsrasc Excel Programming 4 08-22-2018 12:17 PM
Concatenate Macro VBA Concatenate b16 Excel 1 01-09-2017 04:51 PM
Concatenate Macro VBA concatenate the currency too isasa74 Excel Programming 24 12-20-2015 06:01 AM
Concatenate Macro VBA Concatenate with @ symbol anickles Excel 2 02-06-2015 09:39 AM
If, move and concatenate in VBA devcon Excel Programming 0 07-04-2011 12:44 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft