Write a value on all worksheets in the workbook

KhallP

Board Regular
Joined
Mar 30, 2021
Messages
157
Office Version
  1. 2016
Platform
  1. Windows
Good afternoon friends, is there any way to write a value in a specific cell on each sheet of the excel workbook using "Foreach" or in some other way?

Example: Write the number 3 in cell A3 of each sheet of the current workbook
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
How about
VBA Code:
Sub KhallP()
   With ActiveWorkbook.Worksheets
      Range("A3").Value = 3
      .FillAcrossSheets Range("A3"), xlFillWithAll
   End With
End Sub
 
Upvote 0
How about
VBA Code:
Sub KhallP()
   With ActiveWorkbook.Worksheets
      Range("A3").Value = 3
      .FillAcrossSheets Range("A3"), xlFillWithAll
   End With
End Sub
Sorry, I will specify better, I have a spreadsheet with 3 sheets ("Sheet1", "Sheet2", "Sheet3") on each sheet the intervals from A10 to A25 have different data and in cell C20 of each sheet the value will be result of the sum of the intervals A10 to A25 (all with different results on each sheet, that is, the result of cell C20 will always be different on each sheet)
 
Upvote 0
Then why on earth did you say
Write the number 3 in cell A3 of each sheet of the current workbook
which is absolutely nothing like what you appear to want?
 
Upvote 0
Not unless you explain clearly & accurately EXACTLY what you want.
 
Upvote 0
Not as far as I am concerned. Please remember that I cannot see your data, not can I read your mind. What EXACTLY do you mean by
the intervals from A10 to A25 have different data
and
C20 of each sheet the value will be result of the sum of the intervals A10 to A25
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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