Valli is sharing useful VBA examples ad Tips to helps us automating daily tasks.Sub Loop Fill Range() ' Fill a range by looping through cells Dim Cells Down As Long, Cells Across As Long Dim Curr Row As Long, Curr Col As Long Dim Start Time As Double Dim Curr Val As Long ' Change these values Cells Down = 500 Cells Across = 200 Cells.There are times when you are processing a list when you might want to look at the values in the same row, but a couple of columns over. This is far more efficient than selecting the cell two columns to the right, processing your data, then remembering to select two columns to the left and continue. Select will select E251 (3 rows up and 2 columns left). If you want to offset to a column to the left of you or a row above you, use a negative number. You can loop through a list much more efficiently with Offset. When we are dealing with many worksheet, it is a routine thing to copy data from one worksheet to another in Excel VBA.
If you are watching the sheet, the values simply appear. Translated into English, it takes the current cell (Active Cell) and selects the row that is one row down from the current row and in the same column. So if you want to stay in the current cell and read a value two columns to the right, you could use syntax like the following: If you are in cell D254, the code above will reference the cell F254 and read its value into the variable str My Value. The idea is to place Excel into manual calculation mode, run your code, and then switch back to automatic calculation mode.Setting the calculation mode back to xl Calculation Automatic will automatically trigger a recalculation of the worksheet. Calculation = xl Calculation Manual You may notice that when your macros run, your screen does a fair amount of flickering.In this situation, we need to copy the some part the worksheet and paste it in a target worksheet. Range("E1") 'Method 2 'Copy the data Sheets("Sheet1"). Copy 'Activate the destination worksheet Sheets("Sheet2"). We can use two methods to copy the data: Method 1: In this method, we do not required to activate worksheet. The main difference between two methods is, we should know the destination worksheet name in the first method, in second method we can just activate any sheet and paste it.'In this example I am Copying the Data from Sheet1 (Source) to Sheet2 (Destination) Sub sb Copy Range To Another Sheet() 'Method 1 Sheets("Sheet1"). Download the Example VBA Macro File and Explore the code: Example file to download: copy-data-one-sheet-another Excel VBA Developer having around 8 years of experience in using Excel and VBA for automating the daily tasks, reports generation and dashboards preparation.