Macro to paste special from from specific sheet up to before sheet 'Month"

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,563
Office Version
  1. 2021
Platform
  1. Windows
I have code below to copy data and to paste value the data and retain the format


I need to copy the data from sheets "BRT Kirty" up to before sheet "Month" and to paste these as values on these sheets and to retain the format

I need the code below amended to accommodate this

It would be appreciated if someone could assist me

Code:
 For I = Sheets("BRT Kirty").Index To Worksheets.Count


See full code below

Code:
 Sub PasteValues_specficSheets()

Dim LR As Long, I As Long, SH as worksheet

For I = Sheets("BRT Kirty").Index To Worksheets.Count

For Each Sh In ThisWorkbook.Worksheets (I)

If Sh.Visible = True Then

Sh.Activate

Sh.Cells.Copy

Sh.Range("A1").PasteSpecial Paste:=xlValues

Sh.Range("A1").Select

End If

Next Sh

End Sub





 

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.
How about
VBA Code:
Sub howard()
   Dim i As Long
   
   For i = Sheets("BRT Kirty").Index To Sheets("Month").Index - 1
      With Sheets(i)
         If .Visible Then .UsedRange.Value = .UsedRange.Value
      End With
   Next i
End Sub
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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