Relative Content

Tag Archive for vba

Text doesn’t get replaced

I’ve got a simple VBA code which is supposed to open a Word file and replace text “<1>” with text “<2>”,then save file with a new name but it doesn’t do that. Instead it would save the file without changes. In the same time result of “Execute” would be positive(Message box with text “Found” is displayed).

VBA Help in Excel

How do I write a VBA that will give me the ranges for zip codes based on the following:

Run-time error ‘380’: Could not set the Value property. Invalid property value

Private Sub PopulateLayout(ByVal entity_id As Integer) Dim sSQL As String cboLayout.Clear sSQL = “PS_Layout_list @deal_only=1, @entity_id=” & entity_id rs.Open sSQL Do While Not rs.EOF cboLayout.AddItem cboLayout.Column(0, cboLayout.ListCount – 1) = rs(“layout_id”).Value cboLayout.Column(1, cboLayout.ListCount – 1) = rs(“description”).Value rs.MoveNext Loop rs.Close If cboEntity = 4505 Then cboLayout = 14400 ‘ here is where error occurred End […]

Tips for writing code that will be maintained by people who aren’t familiar with good programming practices

I’m a mechanical engineer who works at a design build construction firm, and I’ve taught myself a lot more about coding and good programming practices since I started working just to automate some things we do (mainly VBA Excel). I’m probably still a novice in this respect compared to a full-time programmer, but I’ve learned a fair amount of things that made it easier for me to debug and update the programs I’ve worked on over the years.