Good day. Been on this for more than a week and can't find a solution. New to VBA. I have a data sheet with multiple columns of data. I would like to add, beside each column, a column with the row numbers of each column, and to do this through the range till it hits an empty column. Something like below. My data looks like the first pic. I'd like a VBA that loops through that and turns it into the second pic. I currently use Excel 2013. Would be grateful for any response
UPDATE: Apologies for posting pictures. I attached the sample workbook with the example sheets as in the pics. First two sheets are the before and after sheets. Then i added 2 more sheets to show how i'll be adding columns to the data sheet over time, so the vba needs to work for a dynamic range. Again, grateful for the responses so far
UPDATE 24/09/22: this issue is resolved. The codes worked, thank you so much. I have an additional request: summing total for each unique value, in multiple columns. Similar to how to find for eg. sum of total sales for multiple months for a particular product. I have attached a sample sheet to explain. The update sheets are to show how thr input data worksheet would can expand over time, so the code would need to work for a dynamic range. So far working on it i've found i might need a SUMIF INDEX-MATCH array function, but i don't know how to write it. Would be grateful for any help, but the initial request in this thread is solved, grateful
Bookmarks