Results for "msword vba error"

13 results for this search

Hi,

Quite difficult to guess what might be going wrong within your code ... without seeing it ...

From your description ... it does look much more as a Word VBA issue ... and not so much an Excel one ...

Among the possible solutions, you should have a look at following link ...

https://www.experts-exchange.com/articles/12904/Understanding-and-using-CommandBars-Part-II-Creating-your-own.html

Hope this will help

I'm trying to create new macro that allows me to add a toolbar in a word file containing buttons to do specific action , I tested it and it works fine but I try to use button this message Pop up and prevent me to do anything I donno why and I tested every solution in Google please I need some help to carry on to better understand My problem I posted this question also in stackoverflow https://stackoverflow.com/questions/46286742/macro-is-disabled-by-word-confidentiality

Hello,

merged cells are sources of all kinds of difficulties.

My proposal to fix your issue.

ActiveSheet.Range("A10:C30").Find("Mr. G").Select

Hi Giaco1234 and Welcome on Excel-Pratique

For your concern, you can try

With ThisWorkbook.Sheets("Test")
  .Range("B1") = .Range("A1")
End With

Hello,

1. Copy the procedure named TableNames in a new module in the copy of your file.

2 . Run the procedure.

3. See the name manager (Ctrl + F3)

4. Copy the procedure named UpdateDataInSheets in a module 1 (delete previous version).

5. Run the procedure.

Don't forget to check the results !...

Regards.

Option Explicit
'Rename all tables with smart names
Public Sub TableNames()
Dim wb As Workbook
Dim ws As Worksheet
Dim lo As ListObject
Dim txt As String
    Set wb = ThisWorkbook
        For Each ws In wb.Worksheets
            Select Case ws.Name
                'sheets to ignore
                Case "B_Confin":
                Case Else:
                'sheets to be processed
                txt = Replace(ws.Name, " ", vbNullString)
                Set lo = ws.Cells(1).ListObject
                lo.DisplayName = txt
                Set lo = ws.Cells(6).ListObject
                lo.DisplayName = txt & "2"
            End Select
        Next ws
End Sub
Public Sub UpdateDataInSheets()
Dim loData As ListObject, lo As ListObject
Dim Cell As Range, r As Range
Dim n, arr(1)
Dim dt As Double
Dim nm As String
    Set loData = Range("Business_Confidence").ListObject
    If loData.DataBodyRange Is Nothing = False Then
        For Each Cell In loData.ListColumns(1).DataBodyRange
            dt = Cell.Offset(, 1).Value
            nm = VBA.Replace(Cell.Value, " ", "")
            On Error Resume Next
            Set lo = Range(nm).ListObject
            On Error GoTo 0
            If Not lo Is Nothing Then
                n = Application.Match(dt, lo.ListColumns(2).DataBodyRange, 0)
                If IsError(n) Then
                    arr(0) = Cell.Offset(, 1).Value
                    arr(1) = Cell.Offset(, 2).Value
                    With lo
                        'If .InsertRowRange Is Nothing Then
                            Set r = .HeaderRowRange.Cells(1).Offset(.ListRows.Count + 1)
                        'Else
                            'Set r = .InsertRowRange.Cells(1)
                        'End If
                    End With
                    r.Offset(, 1).Resize(, 2).Value = arr
                End If
            End If
        Next Cell
    End If
End Sub

Hi all,

I've just started to learn about coding in VBA and I have an error in the following code that I don't know how to resolve.

I want to use a CheckBox, the first part If block is working as it should but the second one is not.

When I run the code the error 91 appear saying "Object Variable or With block variable not set".

ActiveSheet.Range("A10:A30").Find("Mr. G").Select

Does anyone know how to resolve this issue ?

Thank you !

Private Sub CheckBox1_Click()

If CheckBox1.Value = True Then
ActiveSheet.Range("A10:A30").Find("").Select

Range(ActiveCell, ActiveCell.Offset(0, 2)).BorderAround _
ColorIndex:=1, Weight:=xlThin
Range(ActiveCell, ActiveCell.Offset(0, 2)).Merge
Range("A10:C10").BorderAround _
ColorIndex:=1, Weight:=xlMedium

ActiveCell.Value = "Mr. G"
ActiveCell.Font.Name = "Arial"
Range(ActiveCell, ActiveCell.Offset(0, 2)).HorizontalAlignment = xlCenter
Range(ActiveCell, ActiveCell.Offset(0, 2)).VerticalAlignment = xlCenter

End If

If CheckBox1.Value = False Then
ActiveSheet.Range("A10:A30").Find("Mr. G").Select
ActiveCell.ClearContents

End If

End Sub

Thank you BrunoM455 for your prompt feedback.

Hello,

I hope you are well.

Please, I've been having problems for a while with my VBA compiler. It no longer recognizes the Worksheet and workbook objects and returns an Error as you can see in the photo below.

excel vba error9of workbook

I tried to debug but can't since.

excel vba error9of workbook debugtesting

I read a comment about resetting VBA settings in Excel(Rétablir Interface VBA par défaut (excel-pratique.com)) but it seems I didn't do it right, since the problem hasn't been solved.

I need your help please.

I've taken your suggestions.

I've renamed all my tables for better understanding.

And I've added macros, and it WORKS!!!

I'm new to Excel and I'm starting to discover that this program is a very powerful software that I will enjoy.

Thanks again.

Good morning,

Hope all is well. I don't know if you all can help me. I am stuck and I don't know what to do?

I have one more document that is challenging to fix. It was working before. I don't know what is the reason of the problem in Macros.

How do you want me to proceed?

Thanks in advance

... sp=sharing

Hello Everyone.

If you are open, I would like your support once more.

I have a similar problem on my first plead above on macro error message. Where Jean-Eric have help me so wonderfully.

I have tried all the codes that I have received in the pass, none of them have worked.

Please view document on the link below, if you are opened in helping me out. The file is large, was not able to paste same on this website.

Thanks in advance.

I really don't know what to say.

Jean-Eric. I really appreciate your continual support, always.

You demonstrates a character of a true friend. One that shows your personality with out complaints, dependable, reliable and supportive.

It seems like procrastination is your worst enemy. and helping others are your best friend.

Thank you again Jean-Eric. for your commitment and passion for excel.

Hello

A proposal to consider.

Regards.

Public Sub UpdateDataInSheets()
Dim loData As ListObject, lo As ListObject
Dim Cell As Range, r As Range
Dim n, arr(1)
Dim dt As Double
Dim nm As String
    Set loData = Range("PMI_17").ListObject
    If loData.DataBodyRange Is Nothing = False Then
        For Each Cell In loData.ListColumns(1).DataBodyRange
            dt = Cell.Offset(, 1).Value2
            nm = VBA.Replace(Cell.Value2, " ", "")
            On Error Resume Next
            Set lo = Range(nm).ListObject
            On Error GoTo 0
            If Not lo Is Nothing Then
                n = Application.Match(dt, lo.ListColumns(1).DataBodyRange, 0)
                If IsError(n) Then
                    arr(0) = Cell.Offset(, 1).Value2
                    arr(1) = Cell.Offset(, 2).Value2
                    With lo
                        'If .InsertRowRange Is Nothing Then
                            Set r = .HeaderRowRange.Cells(1).Offset(.ListRows.Count + 1)
                        'Else
                            'Set r = .InsertRowRange.Cells(1)
                        'End If
                    End With
                    r.Resize(, 2).Value2 = arr
                End If
            End If
        Next Cell
    End If
End Sub

Hello Excel World.

I have a problem. I don't know if you can help me out here.

I have a macros name "Update Sheets" on one sheet #1 "PMI"

When I click the Macros to copy and paste each (country, date and value) into each work sheet database.

I get an error message that states, "Run-Time Error"9" Subscript Out of range".

How can I fix this?

Please view documents below.

Thanks in advance

Corrie

I see. The website site have updated it column to "Reference". Before it was "Blank" no wording under the column. Thanks again. Greatly appreciated.

Hello,

I reviewed the PMI request.

Is this the expected result?

121anton-heatwave.xlsm (140.09 KB)
annotation 2020 03 09 085612

"Hello,

What is the object of the "Added prefix" steps?

Regards."

Is to change the "Reference" column to "DATE" format

Hello,

What is the object of the "Added prefix" steps?

Regards.

Hello Everyone or Anyone.

Can You help me out with something.

I am trying to refresh my data links.

But I am getting an error that says: "expression.error the column of the table wasn't found"

How can I fix this?

Please if you are welling, please view.

Thanks in advance....

112anton-heatwave.xlsm (145.41 KB)

Hi ! Lisa Nguyen,

Here, your Excel File is back, with automatic conversion.

If you agree, you can display the corresponding color with your VBA Module3. Sub RGB_TO_HEX_COLOR()

See my Note in Sheet1.