0

I have 0 experience with VBA and am wondering if there's a way to input information on one sheet, and run a macro to move it into a larger data table on a different sheet in the same Excel file.

The larger data table has columns: Client, Project, Supervisor, Staff, Billing Rate, and Hours worked with one row of data per staff member on each project (Client, Project, and Supervisor remaining the same in every row).

Is it possible to write a script that could take an input of the client, the project, the supervisor and the info for each staff member and insert the necessary rows onto the bottom of my larger data table. The reference to the end of the large table would have to be dynamic as this is supposed to be a working log to keep track of staff. Thanks in Advance :D

braX
  • 11,506
  • 5
  • 20
  • 33
michael_p
  • 3
  • 2
  • 1
    Yes it is possible. Unfortunately SO isn't meant to be a code-writing service though. It's more for questions about existing code that doesn't work. – BigBen Dec 05 '19 at 20:18
  • @bigben I just need a point in the right direction I'm so lost :( – michael_p Dec 05 '19 at 20:27
  • [Here's](https://stackoverflow.com/questions/11169445/error-in-finding-last-used-cell-in-excel-with-vba) how to find the last row of the data table. That is a start for sure. – BigBen Dec 05 '19 at 20:28

1 Answers1

1

The basic idea behind VBA is that you can do everything with VBA you can do using Excel regularly, with the advantage that you can automate it.
The additional automation enables you to use loops (for-loops, while-loops), if-then and other conditional switches, ..., in short, all options of a general programming language.

When I first started with VBA, I used the "recording" feature, in order to get started:
I did some very simple things, like entering something in a cell, and doing some calculations and/or basic searching, then I recorded those actions, and edited the recorded macros and added loops/if-then and other clauses.

Good luck

Dominique
  • 16,450
  • 15
  • 56
  • 112
  • recording a macro is wonderful for learning the syntax and what is under the hood. Sadly, it also obscures the specific thing you might be trying to do with everything related to the task at hand. It also does a lot of Select and other things that you will need to avoid in writing good VBA. So use it to learn syntax and try doing your task. Posting code that *almost* works will help move you along getting to the "good VBA". – SmileyFtW Dec 05 '19 at 20:57