loop and insert

  1. L

    My data should have 6 standard headers, but sometimes these are missing, can a VBA code loop, and insert blank lines, where these should be?

    I was hoping someone would be genius enough to help with this, I would be very grateful. In Colum C of my data (les that 50 rows)- there are usually 6 items for each record. These are: BOOK CA OVER SPEC DIR TOTAL Sometimes, SPEC or DIR may be missing from a record- I would like a blank row...
  2. C

    Loop through range. Use range data as input

    I am struggling to add further functionality to my code. I would like for my code to run a loop through a range of dates, found in column "E:E", and thereby use this input into cell C2 and then perform the rest of my code - saving the file to CSV (SaveAsCSV()). The spreadsheet is such that it...
  3. R

    VBA to assign "id number" into all files in folder?

    Hi all, I am new to VBA but am learning, and have had some very useful help on here previously, I think what I am looking to do should be possible, but am not sure where to start. I have a batch of 600 files in a folder and need to assign a id/reference number (starting at #1261 ) in to cell...
  4. S

    Loop and Insert Row VBA

    Hello - I'm looking for some assistance, I have roughly 5000 rows of data and I need to insert a row between each of them. Basic Statement that i'm looking to achieve is: If Cell in column A has data, (Text, number, etc) then insert row beneath. Loop until cell with out data (text, number...
  5. J

    help to exclude a file

    Hey All, I have code that loops through excel files in a file folder and edits those files. My trouble is that the code is also editing the workbook where the code is saved. Can you take a look at this code and tell me how I can exclude my workbook from the editing loop? Private Sub...
  6. G

    Not able to loop for converting range into image

    Dear All, Please help me with a vba code to convert a particular range to an image through looping. I'm using the below code, however I'm not able to convert range into image through looping. I'm using excel and outlook 2016. Sub sendMailj() Dim TempFilePath As String Dim...
  7. C

    VBA to copy values between sheets skipping blanks

    Hello everyone! So just so everyone knows, I am a VBA newb, self-taught through extremely helpful forums like these. This is my first post and haven't even set up my profile fully. Lol This request will help me and my accounting team here at my job out tremendously! So, thank you for taking...
  8. S

    Insert Multiple Rows in loop

    Hello, I'm facing this problem of inserting rows in a loop. Your help are highly appreciated. Sub InsertMultipleRow() Dim i As Integer i = 6 Do While i < 100 Sheets("Sheet1").Rows("i:i").Insert Shift:=xlDown i = i + 6 Loop End Sub
  9. S

    Excel VBA to Loop

    Hello everyone, I need to make this code run as one. Thank you for your help. Sub InsertSaturday() Dim i As Integer i = 6 Do While i < 100 Cells(i, 3).Value = "Saturday" i = i + 6 Loop End Sub Sub InsertSunday() Dim j As Integer j = 7 Do While j < 100 Cells(j, 3).Value = "Sunday"...
  10. J

    optimizing vba looping code

    Sub Testingloop() Dim endrown As String Dim ex As String Dim ez As String Dim eh As String Dim eg As String Dim el As String Dim ee As String Dim es As String Dim ef As String Dim ei As String Dim i As Integer Dim LastRowColumnA As Long: LastRowColumnA = Sheets("looping").Cells(Rows.Count...
  11. J

    Working with a VBA array

    So I will do my best to write this out. Currently, I have a VBA loop that filters a range of cells looking for a color and then stores that cell reference. After that, I loop backward through the array inserting a row above it. For i = UBound(visibleRowNumbers) To 0 Step -1...
  12. S

    Compile Error: Expected end of Statement using SUM formula in variable range loop

    Hi there, New to this forum and I love it! I have searched and searched but can't seem to find an answer that resolves my problem. I am using a loop in a macro that groups and subtotals columns for data categories. The data the macro is run on varies greatly in size each time, but the...
  13. D

    VB Insert Coppied rows - VB Loop?

    Here is a screenshot of my workbook. http://my.jetscreenshot.com/20092/20160209-nszp-274kb What I am doing now is a manual process. I am copying the above Highlighted rows and then "Inserting Copied rows" under each row that is labeled "original row" to generate the required data in rows...
  14. J

    VBA Loop Evaluates Cell, Copy & Paste it above Current Row, If Criteria is met

    I'm a novice when it comes to VBA, and I have a list of names in Excel 2013 (Running Windows 8.1) and I want to write code that will generate and include all nicknames the person might have, so that if a user enters some variation - it will still be recognized. For example Richard would have...
  15. K

    How can I add another loop to insert worksheets based on a list?

    I want to add a loop that create worksheets with the same name on the list, if the workbook does not have the same named worksheets in a list. How would I add it on this code? Can anyone do it..? Sub DeleteSheet() Dim WS As Worksheet, SheetsToKeep As String Const SheetNameWithList As String...
  16. S

    Macro to loop through all rows of data

    Good Morning, I have created the following macro which is supposed to loop through all the data points and create Outlook calendar entries for each line of data in my Spreadsheet. At the moment it looks like it only enters the first line as an entry to Outlook before stopping. What do I need...
  17. R

    Loop through all worksheets in all sub-folders and enter name and number in A2 and B2 based on sheet name.

    Please help ! I want the macro to go through all the files in a sub-folder and look-up the file names mention in the another excel sheet "Sample 1", and open and paste the "name" in "A2" and "no" in B2. "Sample 1", A B name no. Central 5656 Sustainable...
  18. D

    Find Used Range & Enter Formula

    Hi, I'm using Excel 2013. I'm looking for a VB macro solution. I want to loop through all used cells in column H and enter a formula in each cell. The formula basically divides the figure in cell G with the figure in cell F. I think the formula should be ActiveCell.FormulaR1C1 =...
  19. A

    Add new row and Loop range data from previous sheet - vba excel

    I'm looking for the right code where Sheet2 will add a new row and populate the Column B cell of the new row with data from a range on Sheet1. I need this to occur every time I add new item to the range on Sheet1. So if I have: Sheet1: <code style="margin: 0px; padding: 0px; border: 0px...
  20. S

    Multiple loop inside one another

    Hi all Window 7 / excel 2010 Here comes my problem, I get workbooks full of data but not organised except for one thing the phone number is in the cell below the cell with the valuue "Phone" Currently I can retrieve each number in a sheet and create the list on the sheet 6. here is my code...

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