for next

  1. V

    UDF Loop Freezes Unless Calculating in The Sheet it’s in

    I have multiple UDFSs that loop through cells, I have application.volatile on them with worksheet change events that calculate the sheet. But if I am in a different sheet and press calculate, it freezes. Any suggestions?
  2. D

    For Next with Step Loop missing last value..sometimes

    Hi all...my name is Doug. I have been dabbling in VBA for a couple years and probably been a guest on here a bunch of times. I am new member today! I have some code to fill in a bunch of cells with number incremented by a specified value. It is pretty basic stuff but I have found that it...
  3. R

    Need Help Please

    Hi guys, i need help. i want to do copy-paste diffirent worksheet but with for next loop for example: Worksheets("Sheet1").Range("a1").copy = Worksheets("Sheet2").Range("a1").copy Worksheets("Sheet1").Range("a2").copy = Worksheets("Sheet2").Range("a2").copy etc... Sheet1: Sheet2 i have...
  4. R

    For Each Next Help

    Need a little help with writing a For Each Next loop. I have a set of data on Sheet2 with names in column A, dates in column B, addresses in column C, city in column D, state in column E, and zip in column F. Ideally I need an input box to pop up, the user enters a date and then for every person...
  5. R

    ComboBox HELP

    Hey all, I have two questions... 1.) Is it possible to select multiple choices within a ComboBox? Is it possible to select multiple choices within a ListBox? If so, how? 2.) Assuming it is possible to make multiple selections, I have a list of names in Column A, a list of their respective...
  6. D

    Worksheet check macro sub-routine

    ;) Greetings! I searching for assistance in writing a VBA macro that will check each cell in a range for the existence of a specific text string "Mismatch". If the text string exists a Msgbox "Mismatch Found!"; if not Msgbox "Worksheet Checks Good!" would appear. Worksheet: CREW30 Range...
  7. J

    Compile error "Next without For"

    Hi there, When I run this code I get the compile error "next without for" and I can't figure out why Sub Find_Class_A1_then_Hide() Application.ScreenUpdating = False Dim r, Lastrow, cLastrow, tRow As Long Lastrow = Cells(Rows.Count, "A").End(xlUp).Row For r = 1 To Lastrow cLastrow = Cells(r...
  8. D

    For Next Faster

    Hello, I am using the below code. Is there is a way to have this go faster? Or some way for as soon as it finds the correct cell, to go to next? I am searching through about 1600 cells and 1600 cell2s. I am still new to VBA, any help would be greatly appreciated. For Each cell In...
  9. M

    Default Skipping an i, or multiple i's in a Loop - please help

    I am writing some code to generate multiple pivot tables in excel. My spreadsheet is set up with survey responses to a variety of questions with the question number across the top, and the survey responses below in the column. My problem relates to questions 8, 10, and 13. As you can see in my...
  10. N

    VBA create table from existing table selecting rows based on values

    I need to create a new table in excel on the existing sheet "ScratchPad" by pulling rows from the existing table named "ChemItems" but I only want to pull the rows if a value is populated in the column "Sale Price". Here is an example of the ChemItems table: <tbody> Item Name Sale Price...
  11. X

    Using For Next to delete unwanted rows, but only deletes half at a time???

    So what I am trying to do is delete unwanted rows in one Sheet if they do not meet the validation values from 2nd sheet. I have a tag list with tags that are associated to a system. Some systems are not part of the project so I need to purge these from the excel list before I can run a status...
  12. C

    For Next with variable

    A member of MrExcel was kind enough to help me with the code below. One thing it is lacking is the ability to manage a variable # of columns and rows. I would need to account for that possibility. My thanks for your help! Sub Foo() Dim MyDay As String Dim MyCol As Long, i As Long MyDay =...
  13. S

    Loop through Worksheets

    Hello! I want my code to loop through the worksheets so I used For each-Next,. but it brings up an error "invalid next control variable reference". I have more to my code but for space and time saving I have removed the more lengthy parts. Any help would be much appreciated! Code: Dim...
  14. F

    R1C1 And looping

    Hello everyone! I am quite new at VBA and my boss assigned me a project that requires me to calculate the average, Ann ROR, and standard deviation of various funds using a For Next loop. The spreadsheet given to me has 331 rows and 180 columns. My boss wants me to use Finalrow and FinalColumn...
  15. J

    Loop through multiple ranges

    First off, thanks for looking at this. I am having a problem trying to figure out ow to move to the next set of cells. I have a list of data on say Sheets("Sheet1") that I need, starting in BA8 that goes down 6 rows to column DW. I need to loop through each columns set of six cells, copy and...
  16. V

    Offset and for next

    Hey all, I have a code that I am trying to expand to a range of about 20 rows by 2 columns. I would like for the macro to loop (?) through the entire range and offset each cells of the range 10 columns right, & 100 rows down. Public Sub lmtpastespecial() ActiveSheet.range("a4:b4").Copy...
  17. R

    Skip Mismatches maybe with Do Loop or For Next

    I'm trying to pull data into a template from a source tab matching by account number. However, having trouble when the account numbers in the source tab are not in the template. If its just one account number, or they are separated by good account numbers, the code below works, but if 2 or more...
  18. A

    Using ADO to add data to fields with similiar name.

    I have a table, name myTable in access database in desktop\jwb.accdb. the table has more then 50 fields. the name of the fields: answer1, answer2,....answer50. And I have data in excel column A1 to A50 that I want to add to these fields. data in A1 to answer1 data in A2 to answer2 data in A3 to...
  19. E

    Setting Up Loop for Data pull (match) from other tabs

    Hi All, So I have been struggling very much with setting up a series of Loops and Do While functions in order to pull results from specific tabs, and from specific rows and columns on these tabs (based on known information). Simply: I have two columns to populate with data -CompanyA...
  20. T

    Double For next loop

    Hi, I am quite a newbie on this and try to step up to the next level... The sub below tries to compare a list of new transactions on a worksheet with a second list on another worksheet. If a condition is met it should copy a range from the second list to the first. I tried to write it all in...

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top