Loop, calculate and copy results

JakobP

New Member
Joined
Apr 21, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi everyone

I am not very familiar with Visual Basic and need some help.

I have a table that calculate costs and depreciations based on pre-selected inputs. The inputs are categorized according to the asset in question, numbered from 1-1.000 (representing 1.000 assets in total): Everytime a certain number between 1 and 1.000 is entered in a specific cell (in my case, B17), the rest of the calculation will retrieve the relevant cost inputs from an underlying spreadsheet, e.g. unit costs. This part of the calculations are working fine.

However, I would be pleased if anyone could help me with a simple VBA-formula that:
1) Loops cell B17 from 1 to 1.000
2) Exports the result rows to a sheet within the workbook without overwriting anything.

Thank u.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Without knowing more this seems doable. Unfortunately, your description of what is needed is just too vague and not detailed enough for many list users to help you.

Plus, ideally you provide a link to your workbook. Otherwise, someone willing to assist might need to recreate it to develop and test the necessary code. Put the file on Box, Dropbox, 1Drive, Google Drive or Sharepoint. Provide a link to the workbook using the link icon at the top of the message box.

Also, consider using Mr Excel's excellent add-in called XL2BB which enables you to post a portion of a worksheet. With that add-in you can show relevant data in a usable form. That way someone willing to help you does not have to create fake data or guess what your data looks like. See XL2BB - Excel Range to BBCode for details.
 
Upvote 0

Forum statistics

Threads
1,214,587
Messages
6,120,405
Members
448,958
Latest member
Hat4Life

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