alexxgalaxy
New Member
- Joined
- Sep 19, 2011
- Messages
- 2
Hi, could anyone help me with below?
What needs changing in the following codes if I would like the following conditions met?
What needs changing in the following codes if I would like the following conditions met?
- the actions are done on every sheet except sheet("Master DB") as well as sheet("Summary").
- the InputBox pops up only ONCE and then the same value will be filled in specified range in every targeted sheet.
- the column width for column A is 18.
- the font of the character in the first four rows is Arial with a size of 14.
- the font in point 4 is bold.
Code:
Option Explicit
Code:
[FONT=Arial]Sub AddInfo()[/FONT]
[FONT=Arial] Dim n As Long[/FONT]
[FONT=Arial] Dim MySh As String[/FONT]
[FONT=Arial] MySh = "Master DB"[/FONT]
[FONT=Arial] For n = 3 To Sheets.Count[/FONT]
[FONT=Arial] If Sheets(n).Name <> MySh Then[/FONT]
[FONT=Arial] With Sheets(n)[/FONT]
[FONT=Arial] .Range("A1") = "ABC"[/FONT]
[FONT=Arial] .Range("A2") = "DEF"[/FONT]
[FONT=Arial] .Range("A3") = Sheets(n).Name[/FONT]
[FONT=Arial] .Range("A4") = InputBox("Please enter the date.")[/FONT]
[FONT=Arial] .Range("A4").NumberFormatLocal = "[$-C04]d mmmm, yyyy;@"[/FONT]
[FONT=Arial] .Range("B1:B4") = ":"[/FONT]
[FONT=Arial] .Columns("A:A").ColumnWidth = 18[/FONT]
[FONT=Arial] .Rows("1:4").Font.Name = "Arial"[/FONT]
[FONT=Arial] .Rows("1:4").Font.Size = 14[/FONT]
[FONT=Arial] .Rows("1:4").Font.Bold = True[/FONT]
[FONT=Arial] End With[/FONT]
[FONT=Arial] End If[/FONT]
[FONT=Arial] Next[/FONT]
[FONT=Arial]End Sub[/FONT]