integer

  1. K

    1004 Error at the end

    Hi guys I'm getting a 1004 error with the following code. I've just looked a second ago at this variable = Lastcell. I used a message box and it seems to be empty. Any advise would be great guys. My brain is killing me here. Thanks Option Explicit Sub FullFatGen() Dim...
  2. A

    Two dimensions: collection or dynamic array

    Hello guys, I need a little help. I have written a piece of code in order to perform massive replacement in the entire workbook. Sub fdfd() Dim SheetCounter As Integer Dim RowCounter As Integer Dim ColumnCounter As Integer For SheetCounter = 1 To ThisWorkbook.Sheets.Count...
  3. C

    Compile error: object required

    Below are my attempt to highlight cell that are within certain value across multiple column. The goodCellCount variable are use to keep track of the amount of cell within parameter and goodRowCount are to keep track of row that have all cells(column F to I) within parameters. However,when I try...
  4. S

    First day and last day of the month values in respective textboxes

    Hello How can i get 1st day of the month and last day of the month in respective textboxes with the below code Option Explicit Public gDate As Date, ldate As Date, lastDay As Long Private Sub cmdGetFirstLastDay_Click() Dim yearNo As Integer, monthNo As Integer, dayNo As Integer yearNo =...
  5. J

    Best Practices When Coding Multiple Buttons Performing Similar Actions

    Wowza, Wasn’t sure what was the best way to word my question. I’m currently working on a code that transfers dates from an excel sheet into a webform and selects a specific export button on the website (just pulling reports essentially). Each button pulls a specific report. So there’s a need...
  6. K

    Loop question

    I am trying to create a loop that uses a variable as the end number. This number can range from 1 to 200. Below is what I created. I have tried a variety of variations but I cannot figure out how to get this to work. Any Ideas? 'Loop - Number of times to run - 1 to EndNumber Dim...
  7. B

    UsedRange.AutoFilter error 424 object Required

    Below code give error msg 424 object required when it come to Usedrange.AutoFilter code line. Sub WorkOrderListFile() Dim sheet As Worksheet Dim row_min As Integer Dim row_max As Integer Dim col_min As Integer Dim col_max As Integer ' Select the used range. Set sheet = ActiveSheet...
  8. J

    Find integer value in big range

    Hello, I have a Input Sheet(Sheet1) and a Calc Sheet(Sheet2). at the inputsheet i have a range (B12:2750) where i have to find only the cells that are filled with an integer. (The integer is the value that i have to order.) <vb> Sub PrintNumber() Dim i As Integer Dim rCell As Range Dim rRng...
  9. W

    K-Mean Clustering Code is not working

    Hi guys, I got the codes from online resources, when i run it to do k-means clustering, it seems don't work as it should be (it should be a 6 columns x 4 rows table, but it only returns 5 columns x 3 rows table). I have data in datasheet (worksheet) in 6 columns x 33 rows table. Then, i have...
  10. F

    Random Password Generator

    Good Day I have the following VB code that generates a 10 character alphanumeric password. This code works perfectly fine. However I would like to change the code to include special characters in the password. The characters are limited to !@#$&* [CODE]Sub TenCharPassword() Dim i As...
  11. I

    Loop through workbook and calculate sum in each worksheet

    Hello, I'm trying to have my code figure out how many worksheets there are and to loop through each one to calculate and place the sum of column F in the first blank row in column F in each worksheet. My code is only partly working. Please Help! Sub WorksheetLoop() Dim...
  12. S

    Object Defined error on Range.Offset

    I must be having a brain cramp on this one, I have not run into this problem before. I am trying to clear contents from a dynamic range in a workbook and I am getting an object defined error. I'm wondering if it is because I declared the "clear_rng" as a range, but don't understand why that...
  13. L

    when to use () and when not in vba functions

    Hi I am reading a article about when I should user ( ) and when not. I wrote a code below but not sure why Y =1 Sub myfoo() Dim x As Integer Dim y As Integer x = InputBox("enter number") y = MsgBox(2 * x) MsgBox y End Sub Also, do you know where I can read about this...
  14. B

    Countdown Timer With Multiple Segments

    I am trying to develop a countdown timer that will countdown multiple segments from a Worksheet and keep track of the total countdown time. The following code works for the first segment, but when I read the second segment, my time starts counting by two, when I reach the third segment it...
  15. rinneii

    ColorIndex and Offset

    I need to use the offset property to get color in another column. This is what I have so far: Option Explicit Dim FinalRow As Integer Dim i As Integer Sub Colorfruit() FinalRow = Cells(Rows.Count, 1).End(xlUp).Row For i = 3 To FinalRow If Cells(i, 1).Value = "Grapefruit" Then With...
  16. A

    Localizing Variables

    I am stuck on local vs global variables. If you call a variable within a sub as "sub test(a as Integer)" is a now a global variable? I have simplified a lot of code to the below to demonstrate the issue. Right now I have put in another IF statement using the tmp variable to flip cl_min and...
  17. J

    Help on VBA project

    HI, I am trying to adapt an existingVBA project to copy 11 worksheets from a folder into one workbook, then update a master template. In Column A I have “ABM”, then it runs along for 32 more columns, row 1 is the titles which I don’t need to copyover. There is only 1 worksheet per workbook and...
  18. A

    help creating a FILTER UDF

    here is what I have right now Function FILTERIF(select_range As range, select_column, select_row As Integer, criteria_column1 As Integer, criteria1 As String, Optional criteria_column2 As Integer, Optional criteria2 As String)Dim rows As Integer Dim i As Integer rows = select_range.rows.Count...
  19. K

    Excel VBA Calculate Date According to DayLight Saving

    Hi, I want to calculate DateTime according to daylight saving, when daylight saving is running then calculate date and time accordingly and when it is not daylight saving then calculate date and time accordingly. I found below code from net, and it is using Window's API functionality, when I...
  20. R

    Code is SUPER SLOW with copying and looping merged cells

    I have some code going through 20 rows and 4 columns copying and clearing each line from a selected point to "insert" a row without actually inserting. I can't actually insert the row and I'm working in merged cells. I'm also moving images in a specific column but that doesn't seem to be the...

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