# Posts by dangle

• ## A Macro For Various Data Corrections From List

Re: A Macro For Various Data Corrections From List

I hope the optimism is justified!

Give this a try:

• ## Looping copy/paste help. Copying from column 1 to a spreadsheet

Re: Looping copy/paste help. Copying from column 1 to a spreadsheet

Hi Evan and welcome to the forum

If you are adding code to the post you should wrap it in code tags to make it easier to read. You can edit your post to sort this.

Looking at your macro, you haven't set your variables. What are the values of "i", "Rownum" and "Colnum".

This might help as an alternative, if I've understood your requirements correctly. You can change the range and number of times it repeats to suit.

Code
``````Sub Evan1()
Dim i As Long
Dim r As Range
Set r = Range("A1:A20") 'Change the range to suit
For i = 0 To 15 'Change 15 to set the number of repeats
r.Offset(i * r.Rows.Count, i + 1).Value = r.Offset(i * r.Rows.Count).Value
Next
Set r = Nothing
End Sub``````
• ## Copy Matching Values Rows To New Sheet

Re: Copy Matching Values Rows To New Sheet

Hi Claire and welcome to the forum.

Please could you upload a sample of your data to make it easier to provide a solution.

• ## copy data from a set column in a workbook to rows in a different workbook

Re: copy data from a set column in a workbook to rows in a different workbook

Assuming the file is open, then:

Code
``````Sub Copier2()
Dim i As Long
With Rows("4:6")
For i = 0 To 249
.Offset(i * 3).Copy Workbooks("Workbook2").Sheets("Sheet1").Rows("30:32").Offset(i * 38)
Next
End With

End Sub``````
• ## Macro for iteratively updating a grid based on inputs

Re: Macro for iteratively updating a grid based on inputs

I don't understand how the date fits into your logic.

This will give the output you require but maybe not for the right reasons.

Add code to a standard module in Workbook2. Workbook1 saved as Workbook1.xls. Both files should be in the same folder. If it's not right, please provide more info.

• ## Compare Multiple Coloumns

Re: Compare Multiple Coloumns

Desi

I am not quite sure what you are doing since it looks like you could use a simple if formula, but if you want to read the values you could use a variant like:

Code
``````Sub CompareValues()
Dim a, i As Long
a = Range("A1").CurrentRegion
For i = 1 To UBound(a, 1)
'Do something
Next
End Sub``````

Perhaps you could explain more and provide a sample workbook showing what you are trying to achieve.

• ## A Macro For Various Data Corrections From List

Re: A Macro For Various Data Corrections From List

Hi Bob

This should be possible but please upload a small sample workbook to make it easier to provide a solution.

• ## copy data from a set column in a workbook to rows in a different workbook

Re: copy data from a set column in a workbook to rows in a different workbook

Hi arm

Does this help?

Code
``````Sub Copier()
Dim i As Long
With Rows("4:6")
For i = 0 To 249
.Offset(i * 3).Copy Sheet2.Rows("30:32").Offset(i * 38)
Next
End With

End Sub``````
• ## vba code to copy down a column & paste in row

Re: vba code to copy down a column &amp; paste in row

OK. I think this is what you are after:

• ## Use VBA to open a file with a date in the filename

Re: Use VBA to open a file with a date in the filename

Could you perhaps use the DateCreated property of the FileSystemObject, assuming that the filenames correspond with the creation date?

For example:

• ## Use VBA to open a file with a date in the filename

Re: Use VBA to open a file with a date in the filename

Hi Joe

Are the dates in the filenames in US format?

• ## Multiple Rows to Single Column

Re: Multiple Rows to Single Column

Nitin - welcome to the forum.

This outputs to a new sheet.

Assuming data starts in A1, try:

• ## Compare Range from different workbooks and if range match copy and paste.

Re: Compare Range from different workbooks and if range match copy and paste.

Hi Jacwe

Book1 and Book2 need to be in the same folder. Book2 saved as Book2.xls
Then add the code to a standard module in Book1 and run.

• ## if statement with value between two other values

Re: if statement with value between two other values

For VB:

Code
``If x < 5 And x > -5 Then``
• ## vba code to copy down a column & paste in row

Re: vba code to copy down a column &amp; paste in row

Hi Lior and welcome to the forum.
Without seeing a sample workbook, this is my guess.
It will loop through all the worksheets and do the transpose.

• ## Macro Find Only Consecutive Duplicates in a Column

Re: Macro Find Only Consecutive Duplicates in a Column

Sorry, strictly speaking it is not onto a 'new' sheet so just be careful if you have data on the 'codenamed' Sheet2. I can adjust if necessary.

• ## Macro Find Only Consecutive Duplicates in a Column

Re: Macro Find Only Consecutive Duplicates in a Column

J

This outputs onto a new sheet. Give it a try and let me know if there are any issues:

• ## Find keyword and add an item

Re: Find keyword and add an item

Hi Panwar

I am not sure if you wanted to look for multiple occurences or not so I have allowed for this.

Try:

• ## Copy and overwright rows between workbooks based on a match in a single column

Re: Copy and overwright rows between workbooks based on a match in a single column

One quick thought though. Check the worksheet name in the 'With workbooks' line:

Change:

Code
``With Workbooks("Spreadsheet B").Sheets(1).Range("A3").CurrentRegion.Resize(, ColCount)``

to:

Code
``With Workbooks("Spreadsheet B").Sheets("Sheet1").Range("A3").CurrentRegion.Resize(, ColCount)``

But enter the correct sheet name from Workbook(Spreadsheet B) if it is not 'Sheet1'. I think this may be your issue but will have a further look if not.

• ## Copy and overwright rows between workbooks based on a match in a single column

Re: Copy and overwright rows between workbooks based on a match in a single column

DC

I am heading out now and probably not around for at least 24 hours so won't be able to get back to you. Maybe someone else can pick up if it's urgent, else I will have another look and try to help when I'm back.

Best of luck!