str

  1. Z

    Printing cell value from different sheet to a file

    When trying to print from the sheet 'CashonHand' I get a error 400. The rest of code works fine without this one line. I googled but unable to find a way to make it work. TIA, Dennis Sub nw() Dim afile As String afile = "c:\temp\temp1\nw.txt" If Len(Dir$(afile)) > 0 Then Kill afile...
  2. D

    VBA code to find blanks cell & to see if values are greater than allowed.

    Hi, Please can someone help me? I am trying to put together a code to do the following: 1. Checks for any blank cells in my range 2. Then checks the values of them cells against the cells with the values that shouldn't be exceeded without a reason. Here is my code so far: Sub...
  3. R

    VBA Coding - Excel keeps crashing

    I have the below VBA coding on 3 of my sheets in an excel workbook. My excel crases after few minutes, can someone suggest if there is anything wrong with the coding Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Sheet1.DTPicker1 DTPicker1.Value =...
  4. B

    copy activecell value to next cell to the right

    This code copies the value of combobox1 and puts it in the active cell when the command button is clicked. Private Sub CommandButton1_Click() Dim str As String str = ComboBox1.Value ActiveCell.Value = str End Sub If I have checkbox1 checked on the userform containing this code, I want the...
  5. B

    Convert single string into multiple lines of 1024 or some set max

    Hi! I have some very long sql code that I want to convert into clean lines of 1024 which I can then copy and paste into my vba editor. So I have a userform where i paste the sql code that is in multiple line form and a second textbox which outputs the vba ready code. However, I want to keep the...
  6. D

    Type mismatch '13'

    Hello everyone, I'm working on a code snippet in order to save my useform entry into my Access sheet. The code is <code><code> Next ctrl If IsNull(str) Or str = "" Then MsgBox("Record Saved") DoCmd.RunCommand acCmdSaveRecord -- line that is highlighted when code errors out...
  7. D

    Change cell range so its able to find the first empty cell in 4 columns

    Hi, I would like to change the following code so instead of the code looking for B7,C7,D7,F7 cells I would like it to look for the first empty cell in the same columns. My form is locked so only the active row can be selected and the entries will always be on the same row. So the entries...
  8. M

    Keyword Density

    Hello, I need help. I found on this forum an amazing macro. https://www.mrexcel.com/forum/excel-questions/873686-find-keyword-density-rows-columns.html Sub MG11Aug55Dim Rng As Range, Dn As Range, n As Long, sp As Variant, omax As Long, R As Variant Dim K As Variant, Str As String, Lg, NoStr As...
  9. F

    Join ranges in a single one given from comma separated string

    Hi. I have this string that represents rows and row ranges separated by comma. str = "1,3,6:8,11:12" I want to join those rows in a single range variable (rng). I'm trying with this loop but the issue is initially rng is nothing and the "Union("nothing", Rows(s(0)))" gives error...
  10. Y

    Small VBA module causing "Automation Error Catastrophic Failure"

    Hi folks, this must be a super simple answer, but my Google-fu is utterly failing me. I have the following module in a workbook hosted on a Sharepoint server (Office 2010,2013,2016 users access the file) Public Function DelParens(ByVal str As String) As String While InStr(str, "(") > 0 And...
  11. S

    VBA Find Value and paste ll in between value if seen twice in search (if not, report single)

    Hi All, I've inherited a spreadsheet here and it has stopped working. The macro currently finds a value and reports lines from the data in a new sheet. If the value is found twice it will report every cell in between the first and last value. Example data...
  12. S

    Copy/Paste Multiple Columns in VBA which has Picklist

    Hi, I am trying to validate e Values I am pasting Excel which has the columns of PickList. If I know the copy and paste is multiple rows for single column .Below is the code. But if the paste is multiple columns and Rows how will it work? and The columns 4 and 10 are only have picklist...
  13. CatLadee

    How to List all For Loop variables in a MsgBox?

    Hi all, I am just starting my VBA journey and am 4 weeks into a class to learn it. I'm trying to show the entire list of variables in the For Next Loop in a message box, a la: 1 School MASCOT 2 School MASCOT 3 School MASCOT ... But I can only get it to show the last school in the loop...
  14. I

    Excel 2016 VBA - Compare 2 PivotTables fields for matching values

    Hi please can someone help, Excel 2016 VBA PivotTable objects. I rarely develop in Excel VBA (as I'm a SQL Dev). Overall Goal: Compare a single column [P_ID] value list from PivotTable2 against PivotTable1 filter field, if they exist or not to enable filtering on those valid values in...
  15. Q

    How can I stop all workbook sheets being shown when unprotect code runs

    I have a workbook with a large number of sheets (100+) Ihave a button for administrator/high level user use which unprotects the wholeworkbook which works OK, BUT when the code runs it shows/flashes through allthe sheets as they are being unprotected which is very annoying (and may evenbe a H&S...
  16. R

    Any recommendations to speed up VBA comparison function? [long]

    Wrote this mass of VBA code in order to compare sentences for equality. Any recommendations for speeding it up? Not looking to use other programs (though it would be easier) as VBA is the only current one I have access to. Looking for better algorithms for assignment issue as well as removing...
  17. A

    Compare two differents tables in separate worksheet & display data in a new worksheet

    My question is ; is there a possibility to compare two excel worksheets with a different layout as below? I'm willing to compare an historical worksheets versus a new worksheets and display in a third worksheet what was on the new worksheet that does not exist in the historical e.g : I hope you...
  18. T

    Replace "Expected =" error

    I have an excel spreadsheet that I am trying to remove a substring from the cell and insert into an adjacent cell - mimicking the "Insert Copied Cells" feature in Excel. Problem is that when I try to utilize Replace it gives me "Expected =" as an error. I realize with the current code I would...
  19. I

    Macro Problems

    Hey guys my code below works only partially.. basically whenever it wants. For the first part of the code where it looks for dilutions (ie x5 x10 x20 x2.5) it doesn't recognize decimals.. Can the string value be changes to recognize that? For the C1 part of the code: Seems to never c1 if one...
  20. C

    How to use TEXTJOIN in vba

    Hello, I am trying to use TEXTOIN in vba Sub AAA() Dim str As String str = WorksheetFunction.TextJoin(" ", False, "E2:E6") MsgBox str End Sub This gives "E2:E6" as the return If I try this instead: str = WorksheetFunction.TextJoin(" ", False, E2:E6) I get error Is there a...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top