• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Column to range VBA Code

Status
Not open for further replies.

Joaofrz

New Member
Hello,

can anyone help me to get just the range row 7 to 1500 instead of intire column in the code below?

Code:
Sub tstytre()
Dim j As Long


Application.ScreenUpdating = False


For j = 6 To 14853 Step 3
Columns(j).Copy
Columns(j).PasteSpecial (xlPasteValues)
Next
Application.ScreenUpdating = True


End Sub
 
Code:
Sub tstytre()
Dim j As Long

Application.ScreenUpdating = False
For j = 6 To 14853 Step 3
    Range(Cells(7, j), Cells(1500, j)).Value = _
    Range(Cells(7, j), Cells(1500, j)).Value
    'Columns(j).Copy
'Columns(j).PasteSpecial (xlPasteValues)
Next
Application.ScreenUpdating = True

End Sub
 
Thank you so much. Is there a way to do it but based on a cell criteria by column?for example if 1 row of each column has 1, then copy paste values the entire column or the range 8:1500
 
Basically what I need is a code to fill the numbers in sheet "Eliminações" with the exact combination by acount (column C) and companies combination (cell F7 for example "Fini/one") but only for the columns with the text in row 4 "ADJUST" (sheet "Eliminações")
 

Attachments

  • Book1.xlsx
    15.3 KB · Views: 5
The solution Luke gave worked perfetly, I only have a problem when the loop has to go up to column UYG, it takes forever. That was why I was trying to get there with a differente approach, faster and more direct if possible.
 
Thats Funny. I was trying another way and avoid to "nag" Luke more than I already did.
I didn't understand your reply so that i have looped it to Luke as he had already passed a better solution on the same. Pls wait, he will back to you soon. o_O
 
@Deepak
Thanks for tagging me, and linking back to OzGrid.

@Joaofrz
I don't consider it as "nagging", I like to stick with a topic until I see it completely resolved. When I log into either forum, I check the threads I have replied to and see if there's any new responses. I'm just not on all the time. :) Since our conversation started on OzGrid, I will continue this discussion over there.

That said, I don't want to discourage you from posting here at Chandoo. Rather, it's good to consult as large a group as possible. I only ask that in the future, if you post in multiple places, provide links to the other sources so that we too can learn from what others have posted, and see if the issue has been resolved elsewhere.

Thanks.
 
Status
Not open for further replies.
Back
Top