ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Update Cell in Multiple Sheets - Macro (https://www.excelbanter.com/excel-worksheet-functions/257923-update-cell-multiple-sheets-macro.html)

enna49

Update Cell in Multiple Sheets - Macro
 
My apologies if I have done this incorrectly.
After closing off a previous post I added to this question.

Is there someway to select and update Multiple Worksheets in a Macro, I have
tried a couple of ways below I have included my latest code.

Sheets(Array("Regional Freight-QNRFA", "Int Retail-QNIMR", "Int
Wholesale-QNIMW", _
"Passenger-PS", "Network-NW", "Infrastructure-IS", "Workshop-WS",
"COMB IS & WS")).Select

Dim d As Date
d = InputBox("Enter the desired date.")
Range("C1").Value = d

This will only update the first sheet
Thanking you

Jarek Kujawa[_2_]

Update Cell in Multiple Sheets - Macro
 
Sub Makro1()

Range("C1").Select

Dim d As Date
d = InputBox("Enter the desired date.")

Sheets(Array("Regional Freight-QNRFA", "Int Retail-QNIMR", "Int
Wholesale-QNIMW", "Passenger-PS", "Network-NW", "Infrastructure-IS",
"Workshop-WS","COMB IS & WS")).Select

Selection.FormulaR1C1 = d

End Sub



On 4 Mar, 03:07, enna49 wrote:
My apologies if I have done this incorrectly.
After closing off a previous post I added to this question.

Is there someway to select and update Multiple Worksheets in a Macro, I have
tried a couple of ways below I have included my latest code.

*Sheets(Array("Regional Freight-QNRFA", "Int Retail-QNIMR", "Int
Wholesale-QNIMW", _
* * * * "Passenger-PS", "Network-NW", "Infrastructure-IS", "Workshop-WS",
"COMB IS & WS")).Select

* * Dim d As Date
*d = InputBox("Enter the desired date.")
*Range("C1").Value = d

This will only update the first sheet
Thanking you



enna49

Update Cell in Multiple Sheets - Macro
 
Thank you, you guys are great.
Works perfectly


"Jarek Kujawa" wrote:

Sub Makro1()

Range("C1").Select

Dim d As Date
d = InputBox("Enter the desired date.")

Sheets(Array("Regional Freight-QNRFA", "Int Retail-QNIMR", "Int
Wholesale-QNIMW", "Passenger-PS", "Network-NW", "Infrastructure-IS",
"Workshop-WS","COMB IS & WS")).Select

Selection.FormulaR1C1 = d

End Sub



On 4 Mar, 03:07, enna49 wrote:
My apologies if I have done this incorrectly.
After closing off a previous post I added to this question.

Is there someway to select and update Multiple Worksheets in a Macro, I have
tried a couple of ways below I have included my latest code.

Sheets(Array("Regional Freight-QNRFA", "Int Retail-QNIMR", "Int
Wholesale-QNIMW", _
"Passenger-PS", "Network-NW", "Infrastructure-IS", "Workshop-WS",
"COMB IS & WS")).Select

Dim d As Date
d = InputBox("Enter the desired date.")
Range("C1").Value = d

This will only update the first sheet
Thanking you


.



All times are GMT +1. The time now is 04:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com