1,624 questions with Developer technologies | Visual Basic for Applications tags

Sort by: Updated
1 answer

Word Find second occurrence

Hello from Steve I have two "Word Files: opened Window 1 and Window 2 Objective please is to find second occurrence and selecting the text to copy using the below script Window 1 7 PLATINUM NORWAY Now find using the below script to find it in Window…

Developer technologies | Visual Basic for Applications
asked 2026-04-25T20:54:40.5033333+00:00
SteveD 150 Reputation points
edited the question 2026-04-26T10:42:33.0433333+00:00
simo-k 80,030 Reputation points Volunteer Moderator
2 answers

Word How to loop

Hello from Steve How do I put in the below Script please Sub Scratched() Selection.Find.ClearFormatting With Selection.Find .Text = "Scratched" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop …

Developer technologies | Visual Basic for Applications
asked 2026-04-26T03:36:44.3033333+00:00
SteveD 150 Reputation points
edited the question 2026-04-26T10:40:39.6366667+00:00
simo-k 80,030 Reputation points Volunteer Moderator
1 answer One of the answers was accepted by the question author.

Excel Row Height

Hello from Steve I would like please only Row 1 to Row 300 to have row height adjusted. Sub RowHeight() Cells.Select Selection.RowHeight = 20.25 End Sub Mod moved from : Microsoft 365 and Office | Excel | For home | Windows

Developer technologies | Visual Basic for Applications
asked 2026-04-26T07:41:03.45+00:00
SteveD 150 Reputation points
edited the question 2026-04-26T10:40:09.82+00:00
simo-k 80,030 Reputation points Volunteer Moderator
2 answers

Word dollar blue no hightlight

Hello from Steve I need the below please dollar blue no hightlight Sub Dollar_Dollar_Blue_No_Highlight2() Selection.Find.ClearFormatting Selection.Find.Font.Size = 12 With Selection.Find .Text = "$" .Replacement.Text =…

Developer technologies | Visual Basic for Applications
asked 2026-04-23T21:35:23.1266667+00:00
SteveD 150 Reputation points
commented 2026-04-24T05:11:14.0966667+00:00
SteveD 150 Reputation points
2 answers

Rename Module

I want to rename a module in my VB project in Excel

Developer technologies | Visual Basic for Applications
asked 2026-04-23T12:21:20.83+00:00
Donnie Urbano 0 Reputation points
answered 2026-04-24T02:59:24.21+00:00
Nancy Vo (WICLOUD CORPORATION) 2,900 Reputation points Microsoft External Staff Moderator
2 answers

Using VBA to select text.

Hello from Steve Is this possible please to select text 5PBPX using VBA Mod moved from : Microsoft 365 and Office | Word | For home | Windows

Developer technologies | Visual Basic for Applications
asked 2026-04-20T21:09:48.78+00:00
SteveD 150 Reputation points
commented 2026-04-24T02:37:11.46+00:00
SteveD 150 Reputation points
2 answers

Word Color Red and Highlight Yellow

Hello from Steve I would like to please have the below script Color Red and Highlight Yellow Sub Dollar_Colour_Red_Bold() Options.DefaultHighlightColorIndex = wdYellow With Selection.Find .ClearFormatting .Font.Size = 12 .Text =…

Developer technologies | Visual Basic for Applications
asked 2026-04-21T19:41:00.22+00:00
SteveD 150 Reputation points
commented 2026-04-23T19:15:52.5366667+00:00
SteveD 150 Reputation points
2 answers

Worksheet protection for users

I want to protect worksheets for users and grand vba all rights to adjust cells and add and delete listrows on tables

Developer technologies | Visual Basic for Applications
asked 2026-04-22T20:37:04.0666667+00:00
Carlusha99 0 Reputation points
answered 2026-04-23T05:13:30.8+00:00
Jack Dang (WICLOUD CORPORATION) 16,925 Reputation points Microsoft External Staff Moderator
2 answers

vba: Find and replace only one.

Hello from Steve Find and replace on a single find. VBA Sub AddZeroBeforeThreeDigits() With Selection.Find .ClearFormatting .Replacement.ClearFormatting ' Find any 3-digit number as a group .Text =…

Developer technologies | Visual Basic for Applications
asked 2026-04-19T21:41:35.2+00:00
SteveD 150 Reputation points
commented 2026-04-23T02:41:03.7066667+00:00
Taki Ly (WICLOUD CORPORATION) 925 Reputation points Microsoft External Staff Moderator
2 answers

trying to open a document in Word VBA using Document.Open command, command failed

got runtime error 4198, command failed; filename and path much less that 219 character limit

Developer technologies | Visual Basic for Applications
asked 2026-04-20T17:39:31.27+00:00
Edward Evans 40 Reputation points
commented 2026-04-23T02:21:18.9766667+00:00
Leon Tran (WICLOUD CORPORATION) 1,740 Reputation points Microsoft External Staff Moderator
2 answers

vba: I would like to add bold attribute to certain words (names) in an array

Hello from Steve I would like to please add bold text Sub Rename_Trainers() Dim FindArray As Variant Dim ReplArray As Variant Dim i As Long FindArray = Array("RICHARDSON NORV", "D & B WEATHERLE", "THURLOW O'MALLE",…

Developer technologies | Visual Basic for Applications
asked 2026-04-14T01:44:39.2033333+00:00
SteveD 150 Reputation points
edited the question 2026-04-22T15:37:45.8233333+00:00
simo-k 80,030 Reputation points Volunteer Moderator
1 answer

Word if not found then

Hello from Steve Objective if not found then move to next Sub Moving_Numerals() Application.ScreenUpdating = False Do Selection.Find.ClearFormatting Selection.Find.Font.Size = 12 With Selection.Find .Text = "|" .Replacement.Text =…

Developer technologies | Visual Basic for Applications
asked 2026-03-25T20:11:02.0266667+00:00
SteveD 150 Reputation points
commented 2026-04-22T09:06:27.01+00:00
Surya Amrutha Vaishnavi Lanka (INFOSYS LIMITED) 2,035 Reputation points Microsoft External Staff
2 answers

Listened to Co Pilot

Hello from Steve Now all I need please is to open Sub OpenForm2() Const strFolder As String = "C:\Tab Form\Input Stakes" Dim doc As Document With Application.FileDialog(FileDialogType:=1) ' 1 = msoFileDialogOpen .Filters.Clear …

Developer technologies | Visual Basic for Applications
asked 2026-04-05T04:25:19.53+00:00
SteveD 150 Reputation points
commented 2026-04-22T06:18:55.6266667+00:00
Nancy Vo (WICLOUD CORPORATION) 2,900 Reputation points Microsoft External Staff Moderator
2 answers

Word script is not functioning.

Hell from Steve The below script is not functioning, What is required please Sub Rename_Trainers() Dim FindWords As Variant, ReplaceWords As Variant Dim i As Integer FindWords = Array("MCKAY HARRINGTO", "WALKER BERGERSO",…

Developer technologies | Visual Basic for Applications
asked 2026-04-02T23:06:03.0333333+00:00
SteveD 150 Reputation points
commented 2026-04-22T05:45:31.2366667+00:00
SteveD 150 Reputation points
4 answers

Excel Delete the numerals

Hello from Steve The below works perfectly I would like please to take it to another step. At this time It has moved X0312 to the left cell Can it now delete X0312 Leaving Hephaestus Sub CopyNumbersOnly() Dim cell As Range, num As String, ch As String,…

Developer technologies | Visual Basic for Applications
asked 2026-03-17T01:38:36.6033333+00:00
SteveD 150 Reputation points
commented 2026-04-22T04:40:55.17+00:00
Surya Amrutha Vaishnavi Lanka (INFOSYS LIMITED) 2,035 Reputation points Microsoft External Staff
1 answer

Word find only Font 12

Hello from Steve How do I please only find font 12 Sub ReplaceMultipleNames() Dim FindWords As Variant, ReplaceWords As Variant Dim i As Integer FindWords = Array("WALKER BERGERSO", "Orange", "Banana") ReplaceWords =…

Developer technologies | Visual Basic for Applications
asked 2026-03-20T21:37:51.33+00:00
SteveD 150 Reputation points
commented 2026-04-21T12:21:15.2633333+00:00
Varsha Dundigalla(INFOSYS LIMITED) 4,865 Reputation points Microsoft External Staff
2 answers

vba: Find/Replace digits and formatting That replacement text contains a group number that's out of range

Hello from Steve Objective is when three digits found put a zero in at the beginning. That replacement text contains a group number that's out of range Sub AddZeroBeforeThreeDigits() With Selection.Find .ClearFormatting …

Developer technologies | Visual Basic for Applications
asked 2026-04-19T21:33:31.0633333+00:00
SteveD 150 Reputation points
commented 2026-04-21T09:13:46.2+00:00
Nancy Vo (WICLOUD CORPORATION) 2,900 Reputation points Microsoft External Staff Moderator
1 answer

In word if four numerals located add a zero at the beginning.

Hello from Steve How do I do in VBA the below please. In word if four numerals found add a zero at the beginning.

Developer technologies | Visual Basic for Applications
asked 2026-04-05T01:02:44.7833333+00:00
SteveD 150 Reputation points
commented 2026-04-21T08:49:21.22+00:00
SteveD 150 Reputation points
2 answers

Find font 12

Hello from Steve Objectives replace with font 12 Sub AddZeroBeforeThreeDigits() With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Text = "([0-9]{2})" .Replacement.Text = "000\1" .Forward =…

Developer technologies | Visual Basic for Applications
asked 2026-04-20T07:25:19.0266667+00:00
SteveD 150 Reputation points
commented 2026-04-21T08:44:52.3133333+00:00
SteveD 150 Reputation points
2 answers

vba: Compile Error: Expected variable or procedure, not module

Hello from Steve Compile error: Expected variable or procedure, not module Sub AddZeroBeforeThreeDigits() With Selection.Find .ClearFormatting .Replacement.ClearFormatting ' Find any 3-digit number as a group .Text =…

Developer technologies | Visual Basic for Applications
asked 2026-04-19T21:50:34.99+00:00
SteveD 150 Reputation points
commented 2026-04-21T08:41:45.76+00:00
SteveD 150 Reputation points