How to generate a list of dates from multiple ranges, and match it with adjacent cell values

user8384641

enter image description here

Columns B to D are what I have in my raw sheet, and the next 2 columns is what I want to achieve with a click of a button. Would really appreciate some VBA coding help on this cos I have no idea where to start (VBA newbie here).

Thanks!

hung34k

I think this code will help you problem

Dim dStart As Date
Dim dEnd As Date
Dim dDate As Date
Dim iCol As Integer
Dim iColDate As Integer

iCol = 2
iColDate = 2

Do While Cells(iCol, 2).Value <> ""
    dStart = Format(Cells(iCol, 2).Value, "dd/mm/yyyy")
    dEnd = Format(Cells(iCol, 3).Value, "dd/mm/yyyy")
    For dDate = dStart To dEnd
        Cells(iColDate, 6).Value = dDate
        Cells(iColDate, 7).Value = Cells(iCol, 4).Value
        iColDate = iColDate + 1
    Next
    iCol = iCol + 1
Loop

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Generate adjacent elements from List

From Dev

Generate years of date ranges from a set of dates

From Dev

How to generate a list of ranges to subset rows from pandas dataframe?

From Dev

Returning multiple adjacent cell results from an min array which may include multiple duplicate values

From Dev

Get a list of date Ranges from a list Of dates

From Dev

How to subtract adjacent cell value from a cell

From Dev

Parsing multiple dates from cell

From Dev

How to add values to multiple ranges?

From Dev

How do i reference values from various ranges within a list?

From Dev

How to select dates [not] between list of ranges

From Dev

How to compress a list of dates into ranges in javascript?

From Dev

How to compress a list of dates into ranges in javascript?

From Dev

Generate unique non-overlapping ranges from list of ranges in PHP?

From Dev

how to match values from a list to another

From Dev

How to match the cell values and copy them from different sheets

From Dev

How to match a list of dates to a pattern?

From Dev

Generate a list of lists from a list of dates

From Dev

String not allowed? How to define max limit of ranges as cell values from csv column?

From Dev

How to find MySQL rows based on sum of values on adjacent dates?

From Dev

logstash, generate multiple fields from multiple match

From Dev

Match and replace a string from a column in multiple ranges on multiple sheets

From Dev

Populating a list of dates from a few date ranges in SQL server

From Dev

How to split values from one cell to multiple cells using bash

From Dev

Copy ranges from multiple worksheets into one worksheet, in first empty cell

From Dev

How can I get adjacent values from one sheet and sum them up based on the content of another cell in the current sheet?

From Dev

How to take multiple values from a python list?

From Dev

Index multiple, non-adjacent ranges in numpy

From Dev

how to split a list into multiple lists with certain ranges?

From Dev

Retrieve row number from html table which match the given multiple cell values

Related Related

  1. 1

    Generate adjacent elements from List

  2. 2

    Generate years of date ranges from a set of dates

  3. 3

    How to generate a list of ranges to subset rows from pandas dataframe?

  4. 4

    Returning multiple adjacent cell results from an min array which may include multiple duplicate values

  5. 5

    Get a list of date Ranges from a list Of dates

  6. 6

    How to subtract adjacent cell value from a cell

  7. 7

    Parsing multiple dates from cell

  8. 8

    How to add values to multiple ranges?

  9. 9

    How do i reference values from various ranges within a list?

  10. 10

    How to select dates [not] between list of ranges

  11. 11

    How to compress a list of dates into ranges in javascript?

  12. 12

    How to compress a list of dates into ranges in javascript?

  13. 13

    Generate unique non-overlapping ranges from list of ranges in PHP?

  14. 14

    how to match values from a list to another

  15. 15

    How to match the cell values and copy them from different sheets

  16. 16

    How to match a list of dates to a pattern?

  17. 17

    Generate a list of lists from a list of dates

  18. 18

    String not allowed? How to define max limit of ranges as cell values from csv column?

  19. 19

    How to find MySQL rows based on sum of values on adjacent dates?

  20. 20

    logstash, generate multiple fields from multiple match

  21. 21

    Match and replace a string from a column in multiple ranges on multiple sheets

  22. 22

    Populating a list of dates from a few date ranges in SQL server

  23. 23

    How to split values from one cell to multiple cells using bash

  24. 24

    Copy ranges from multiple worksheets into one worksheet, in first empty cell

  25. 25

    How can I get adjacent values from one sheet and sum them up based on the content of another cell in the current sheet?

  26. 26

    How to take multiple values from a python list?

  27. 27

    Index multiple, non-adjacent ranges in numpy

  28. 28

    how to split a list into multiple lists with certain ranges?

  29. 29

    Retrieve row number from html table which match the given multiple cell values

HotTag

Archive