How do I change the range in this code.

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
'for' Loop @Fluff need your help to edit this..
This code was shared by Fluff last year which worked correctly in the previous project. At first the data extracted was filled in around 600 rows but when the value of the amount to be extracted has increased, it is not possible to get the data in 600 rows. Hence the formulas in rows after the 600th row have been shifted to the top so that I can get unlimited rows to fill the data.
If the number of rows is avoided and changed to unlimited rows it will be really helpful in future.
I am trying this code by changing the range in the code by editing it. But I am getting a run time error 1004 at this line. Can someone please help me to correct it.? I want to add this code at the end of the existing code.
Rich (BB code):
         Cells(2000, .Offset(, -14).Column).End(xlUp).Offset(1).Resize(2).Value = .Offset(.Count - 2).Resize(2).Value
Link to the file is below
Shift amounts.xlsm
 
Last edited:
Got it. Added one more line and got the line numbers too.
Rich (BB code):
.Cells(Rows.Count, 5).End(3).Offset(1).Resize(dr) = drng.Columns(4).Value
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Too soon you said. I am getting one more error. I am getting amounts in the particular column and cash in the amount column. I think I will be able to correct it. Let me give it a try. :)
 
Upvote 0
Whoppee!! Finally corrected all the codes.
Now the ball is in your court. You will have to connect all the modules to one button only. I already tried that many a times but was not able to. The extract and daily sheets will be hidden from the user. So, when I run the code it should end in Sheet Get total in cell G2.
 
Upvote 0
Upload your workbook as it now, so I don't have to go back through and make all of the changes.
 
Upvote 0
Now the ball is in your court. You will have to connect all the modules to one button only. I already tried that many a times but was not able to.
You should be able to add Call statements to the end of the code for your first button to get the rest of the modules to automatically run.
 
Upvote 0
You should be able to add Call statements to the end of the code for your first button to get the rest of the modules to automatically run.
I already tried that. But the first code is written in a way I can't understand and it is connected to the extract sheet too. Check the sheet name of Extract. You also can't edit it. Extract sheet not the code.
 
Upvote 0
Hoja1.png

Now what could be Hoja1 no idea.
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,935
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top