1. M

    Creating generic update statement

    Hi All, I'm trying to load data from excel to sql server. For this I created an insert statement which is very generic means this statement can be used for any table. I just have to change the name of the sheet and it will automatically pick up the names of the columns and their values from the...
  2. H

    VBA - Content Banding

    Hi, I am using the below code for content banding whenever a value changes in column B Can anybody please amend the code to look at visible rows. Like when data is filtered. Sub Colorize() Dim r As Long, val As Long, c As Long r = 1 val = ActiveSheet.Cells(r, 2).Value c = 34...
  3. M

    Would like to sort numbers in column smallest to largest

    I would like to sort cell values in a single column from smallest to largest. However, I can't seem to make my code work. I would like for my column to constantly sort the column when it is updated via its formula. Below is my code. I made an If statement so that whenever the range of cells are...
  4. C

    excel vba Add check and then use different reference and source

    So I am using the below code and it works perfectly thanks to some help on here but I want to add a check so that if the row has data but the value of ws1 column G is empty then I want to get the value of ws1 G by using ws1 E as the reference and getting the value for G from ws2 column A. The...
  5. C

    excel vba two way match, can this be tweaked to use two way matching?

    So I had a great deal of help coming up with this code which works flawlessly but I was wanting to know if anyone can see a way to do two changes, 1) Make it match both column A and column L so be a match and B if no match is found then add the record to the next available row? Thanks in...
  6. marreco

    Copy sht1 to sht2 based criteria (Script.Dictionary)

    I need copy data to another sheet My tab("Relatorio") hava CFOP in column M, if find any value start 1 or 2 like this( <tbody> 1253/AA 1949/ZZ 2102/AA 2353/AA 2920/AA) </tbody> Copy to tab("Saida") case start like this( <colgroup><col width="64" span="3"></colgroup><tbody>...
  7. E

    Maximum possible allocation given constraints

    Hey Guys, I'm not too sure how to approach this but i think it's a VBA problem and i'm having a lot of trouble figuring it out. Apologies in advance... it's a long one lol TL;DR The problem is i'm trying to find the optimal allocations to result in the highest possible value given some...
  8. M

    Excel VBA InStr Function to delete string of text within a cell

    I have a strings of text similar to the following (4010059877-TUR36036133 or TUR603916## 401007329) in column "AK".I need to Eliminate the TUR######## which can be at any point in the cell and has a different number behind it each time. Is There a way to delete only this part of the cell? I...
  9. BrianGGG

    Pivot Table - Drill Down does not filter rows

    I can't tell whether this is the expected behavior or not, but I am getting more data than I would have expected when I do "show details" or Drill Down from within a Pivot Table. Here is a simple dataset: <colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>#DAE7F5[/URL] "]...
  10. J

    VBA macro - posting over last cell with blank value

    I have an almost perfectly functioning macro which matches rows in one table to another, and then imports any rows that aren't present in the source table onto the end of the destination table. The ONLY problem i'm having, is that one section of the very last row that gets pasted gets...
  11. D

    Alter userform code to search multiple sheets instead of one.

    Hi, Please can someone help me? I would like to alter the following code so it searches all my workbooks sheets instead of just one. Here is my code: Private Sub CommandButton1_Click()Dim at As Long, LR As Long, x As Long, j As Long, val As Double If TextBox1.Value = "" Or TextBox1.Value =...
  12. S

    Google translate excel vba

    Hi I use below =Translate() function to translate a text the below code works on all language except english to arabic (it works arabic to english) what is wrong in this code?? or can anyone suggest a alternate code for translating english to arabic Function ConvertToGet(val As String)...
  13. P

    Find Min Value from given range

    I am trying to find the minimum value on a given range. However, my range starts with a character and the row is formatted as Text. I worked around it by using the Val function but I was wondering if there is an easier way to find the minimum value. Range C21:C25 are blank in this current range...
  14. K

    Input value into sheet, vba

    The following macro works only about 80% of the time. I'm pretty sure the problem lies with the 3rd party software xlwings. I'm using xlwings to call Excel. The Macro is so simple that I seriously doubt the problem lies with Excel. Then again, I don't see why there should be a problem with...
  15. A

    Use of code more than once on the same worksheet

    Hi All, I cannot seem to figure out how to get this code to work multiple times on the same Worksheet (I am definitely a beginner when it comes to VBA). So much so, that an awesome member helped out on this forum with the below code to hide and show rows (2-43) based on a number entered into a...
  16. J

    VBA to sum parent/child hierarchy values based on given hierarchy level

    Hi, I have data that looks like columns 1 and 2 of the following: <tbody> Level Value Tree Index Current Output Expected Output 1 1 1 1 3 2 1 1.1 1 2 3 1 1.1.1 1 1 1 1 2 1 6 2 1 2.1 1 5 3 3 2.1.1 3 3 3 0 2.1.2 0 1 4 1 1 1 1 2 3 2 4 2 1 3.1 1 1 3 0 3.1.1 0 0 2 1...
  17. S

    VBA code help

    Lads, This post relates to my previous one as no one is replying :) I need to amend code so row is added. At the moment code only removes row. Million thanks. Sub test() Dim cnt, rw As Integer Dim val As Variant...
  18. S

    VBA runtime error

    Lads, I have issue with my manually entered data on excel spreadsheet misaligning when data is refreshed from MS query e.g row is added or removed by query. I have came across this: I have tried to follow...
  19. T

    Function code triggering

    Further to this thread of mine: I have the following in Module1: Option Explicit Function MyFn(firstval As Double, val As Double) As Double If firstval = 1 Then MyFn = val...
  20. T

    Auto update a UDF value

    I have a UDF that depends on the value on another sheet: Option Explicit Function MyFn(val As Double) As Double If Sheet1.Cells(1, 1).Value = 1 Then MyFn = val + 10 Else MyFn = val + 20 End If End Function So in Sheet2, cell B2, I...

Watch MrExcel Video

This Week's Hot Topics

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
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 "".
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