1. Z

    vb listing problem

    I have an If loop comparing values. I am trying to move data from sheet "clean18" to sheet "monthcompare" based on the criteria. Everything in the code works. there are no errors. I just can't get the data from "clean 18" to list in "monthcompare" correctly. I would like the "clean18" data to be...
  2. T

    XMLHTTP navigation and obtaining table.

    Hi all, The code below works fine in order to copy a table from a website into Excel. Sub GetData() Dim XMLPage As New MSXML2.XMLHTTP60 Dim HTMLDoc As New MSHTML.HTMLDocument Dim URL As String URL = ""...
  3. davewatson86

    vba adding items to combobox from large list with multiples

    Hello all i am trying to add all the unique values from my range with the below code. Private Sub UserForm_Initialize() Dim sngLeft As Single Dim sngTop As Single Dim ColNum, i As Integer Dim Name, myString As String Dim strFound As Boolean Call ReturnPosition_CenterScreen(Me.Height...
  4. C

    Getting the formula in this For loop to include the current column(colnum)

    This code Dim X As Range Sheets("Budget").Select For i = colnum + 1 To 54 Cells(30, i).Value = Cells(30, i - 1).Value - Cells(18, i).Value If Cells(30, i) = 0 Then MsgBox "Balance is 0 at col " & i & " " & " and week " & Cells(2, i) Range(Cells(30, i...
  5. C

    Keeping a Public variable always available

    I have this Public colnum As Long Sub Callcolnum() colnum = Round((Date - DateValue("12/20/2017")) / 7, 0) MsgBox colnum End Sub in a modole renamed to COLNUMDECLARATIONCODE and this Private Sub Workbook_Open() Callcolnum at the beginning of ThisWorkbook code. Everything works fine - until...
  6. C

    Making a Public variable work as it should

    I'm trying to use this as a Public or Global variable colnum = Round((Date - DateValue("12/20/2017")) / 7, 0) I did this: Insert -> Module: Public colnum As Integer Function UpdateCorrectColumn() As Integer colnum = Round((Date - DateValue("12/20/2017")) / 7, 0) End Function Result: Run...
  7. K

    Move to the next blank cell

    I know this is a simple one but i can't get the correct syntax, this macro prints URLs from table from a webpage, the problem is each new table starts in Row 2, what i need is for the first table to start in Row 2 but an new tables should start at the end of the last table printed. I have used...
  8. K

    Url as text

    This is part of a code i use to download data from a webpage, what i would like to add is the ability to download urls as text so i can then use the urls separately. Sub ProcessHTMLPage(HTMLPage As MSHTML.HTMLDocument) Dim HTMLTable As MSHTML.IHTMLElement Dim HTMLTables As...
  9. H

    Why do I need an "& 1" here?

    Why does this code require the "& 1" in the conversion from column letter to number? Dim ColNum As Long Dim ColLet As String ColLet = InputBox("What is the column letter of the column you want to analyze?") ColNum = Range(ColLet & 1).Column MsgBox ColNum If I remove the & 1 I get an...
  10. C

    Picking HTML with VBA

    Is there a way to get just English from web HTML? I am looping through the children and it gets all the languages. How can I get HTMLTable and HTMLSeason to loop at the same time? Here is my code: For Each HTMLTable In HTMLTables For Each HTMLSeason In HTMLSeasons...
  11. C

    VBA to extract info from web HTML

    I'm trying to pull info from a website with VBA. With this code: Option Explicit Sub BrowseTVDBWithQueryStringAndXML() Dim XMLPage As New MSXML2.XMLHTTP60 Dim HTMLdoc As New MSHTML.HTMLDocument Cells.Select Selection.ClearContents XMLPage.Open "GET"...
  12. R

    VBA to replace negative values with zero's

    Hello all, I am trying to figure out the VBA to replace all negative values in a specific range, on a specific worksheet "MonteCarlo", Range "S3:AMD163". I have tried unsuccessfully couple of times with the following code: Amy help from a more seasoned VBA writer would be appreciated! Sub...
  13. B

    issue with inserting Columns

    Sub AddAColumn() Dim varUserInput As Variant Dim ColNum As Variant varUserInput = InputBox("Enter Column Number where you want to add a Column:", _ "What Column?") If varUserInput = "" Then Exit Sub ColNum = varUserInput Rows(ColNum & ":" & ColNum).Insert Shift:=xlDown Rows(ColNum...
  14. M

    Master Worksheet with command Button to update data

    I need to increment the column index in the summary sheet each time I run the code or click the command button. The Below code is able to do the job 1 time. When I click the command button the Date should be added in the header, then the result of each sheet (row by row). The result should look...
  15. R

    Column references in VBA

    Hi all - New to VBA and this forum. Hoping to find a quick answer to what is probably very basic. I am writing a macro that will loop through spreadsheets with a varying number of columns and rows. One of my needs is to find the minimum and maximum value in the active column based on an...
  16. C

    Would anyone know of a shorter way of doing this...

    ...maybe with a For loop that would not require repetitive statements with only two unique values that change [i.e., the Case is column number and the date] Dim d1 As Date colnum = Round((Date - DateValue("11/16/2016")) / 7, 0) Select Case colnum Case Is = 44 d1 = DateValue("9/17/2017")...

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