Linked Questions
4,308 questions linked to/from How can I avoid using Select in Excel VBA?
1 vote
4 answers
58k views
Excel VBA to loop and copy paste on variable ranges to variable ranges [duplicate]
I have a loop which changes the ranges of the copy cells and the paste cells. This is working with Select - but is causing the code to run slowly. How can I improve this to not use the Select? ...
0 votes
2 answers
14k views
How to copy paste destination without using activate sheet [duplicate]
I'm having a problem with my macro, I run it from one sheet(A) and I need to copy cells from sheet(B) and paste it to sheet(C) but I could only make it changing sheets, there is any way to do that ...
0 votes
1 answer
8k views
Excel vba - for each cell in selection [duplicate]
This is just a part of my code: Set ws1 = Sheets("Source") Set ws2 = Sheets("Destination") finalrow = ws1.Cells(Rows.Count, "A").End(xlUp).Row ws1.Range(Cells(2, "B"), Cells(finalrow, "C")).Select ...
0 votes
1 answer
3k views
Declare cells or range as variant in VBA [duplicate]
It would be very basic question. I want to declare cells as variant, to substitute repeated typing, like a = cells(1,1) or a = range("a1") then a.select or a.value, etc.. but error occur with ...
3 votes
2 answers
749 views
Other method than Select in VBA [duplicate]
x.Worksheets("Sheet1").Activate Range("A65536").Select ActiveCell.End(xlUp).Select lastrow = ActiveCell.Row Range("A2:A" & lastrow).Copy y.Worksheets("Sheet1").Range("a65536").End(xlUp).Offset(1,...
1 vote
2 answers
873 views
VBA - Too Slow with With and selection Command. How Can I optimize it better to run faster? [duplicate]
I am selecting a range and using that selection inside the With Command and as you all know, the .Selection command is going to slow down the process. What is the better way to write this code, to run ...
-1 votes
1 answer
1k views
Copy a range and paste each cell value in the range to a specific new cell in excel [duplicate]
I basically need to clean up this code that I made up myself to save me from repeatedly copy and pasting! Please advise? Sub cp() Worksheets("copy").Select Range("b2").Select Selection.copy Range("...
2 votes
1 answer
423 views
Excel VBA: Update the formatting for all worksheets [duplicate]
I read through a few online tutorials, and use the macro record to learn how to set formats. But I am wondering is there a way to do the following, without using .Select? Or what is the preferred way ...
0 votes
2 answers
398 views
Excel 2010 work with multiple named ranges [duplicate]
My question is: Im working with named ranges in a large workbook. I need to copy data say from some named range in some worksheet x and paste it on another named range say wksheet y before i can sort ...
-1 votes
1 answer
475 views
VBA: code makes my page jump when running [duplicate]
I have use a code from the internet and customized it for myself, when I run this, which does do what I want it to, it takes for ages and my page seems to jump a lot as its running. It run's through ...
-2 votes
1 answer
392 views
How do I avoid the select in VBA. Need to to have Main as visible and other sheets hidden [duplicate]
How do I avoid the select in VBA. Need to to have Main as visible and other sheets hidden. Below are the codes I am currently using: Sub Run_Historical() 'Application.ScreenUpdating = False Dim ...
0 votes
2 answers
376 views
Select a Column without using .Select [duplicate]
I have created a VBA macro in excel. It works; however, every forum I read states I should avoid using Select. As I am a newbie, I do not know how to implement it nor how it would work. The code ...
0 votes
1 answer
276 views
Excel VBA: Run macro without selecting cell [duplicate]
I am writing a VBA macro that imports some text from a text file and then I am splitting the text based on the delimiter ^. I have managed to get this working but am only able to run the macro if is ...
0 votes
1 answer
79 views
VBA column doesn’t delete whenever header appears on sheet [duplicate]
I copy and paste one sheet to the other, but the amount of data always changes. Whenever I paste, a column at the end of the sheet labeled 'Grand Total' appears but it messes up the data on another ...
0 votes
1 answer
71 views
Optimize VBA Range Copy/Paste [duplicate]
I have this current code that copies and pastes values in a loop. It works fine, but it takes a long time to complete when there is a lot of data. I think there is a more efficient way to do this with ...