Is it possible without VBA?

Alex Piotto

Board Regular
Joined
Jul 5, 2016
Messages
82
Office Version
  1. 2007
Platform
  1. Windows
Hi.
Just out of curiosity, but also good for learning...

I have two sheets, VENDAS and RESUMO.
Inside VENDAS I have a few NAMED cells, with some text and numbers inside.
Values of NAMED cells will change overtime, so I made a button and a script.

With this script I send the NAMED cells values into RESUMO sheet, one row at a time, every time I click the Button.

VBA Code:
Private Sub CommandButton1_Click()

        lastRow = Sheets("RESUMO").Cells(Rows.Count, "A").End(xlUp).Row
       
        ThisWorkbook.Sheets("VENDAS").Range("DATAVENDA").Copy
        ThisWorkbook.Sheets("RESUMO").Range("A" & lastRow + 1).PasteSpecial Paste:=xlPasteValues
       
        ThisWorkbook.Sheets("VENDAS").Range("SUBSORVETES").Copy
        ThisWorkbook.Sheets("RESUMO").Range("B" & lastRow + 1).PasteSpecial Paste:=xlPasteValues
        
        ThisWorkbook.Sheets("VENDAS").Range("SUBMASSAS").Copy
        ThisWorkbook.Sheets("RESUMO").Range("C" & lastRow + 1).PasteSpecial Paste:=xlPasteValues
       
        ThisWorkbook.Sheets("VENDAS").Range("SUBPADARIA").Copy
        ThisWorkbook.Sheets("RESUMO").Range("D" & lastRow + 1).PasteSpecial Paste:=xlPasteValues
       
        ThisWorkbook.Sheets("VENDAS").Range("SUBPASTELARIA").Copy
        ThisWorkbook.Sheets("RESUMO").Range("E" & lastRow + 1).PasteSpecial Paste:=xlPasteValues
       
        ThisWorkbook.Sheets("VENDAS").Range("TOTAL").Copy
        ThisWorkbook.Sheets("RESUMO").Range("F" & lastRow + 1).PasteSpecial Paste:=xlPasteValues
       
        Application.CutCopyMode = False

Sheets("RESUMO").Activate
Sheets("RESUMO").Range("B1").Select
           
End Sub

Everything works fine.

What I am asking is: It is possible to achieve the same without VBA?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi
Do you want to have the cells in the RESUMO sheet get the values only at the pressing of the button or are you happy for it to be instant?
if you have a named cell called DATAVENDA you can just have a formula of
Excel Formula:
=DATAVENDA
if you want to have the values be triggered then the VBA may be the only way. Unless you want to turn off auto calculate, then you can hit F9 to send the values.
Or you could put in a button to do that, but that would be overkill
 
Upvote 0
Hi rondeondo thank for reply.

I do not actually "need" a button... but the button allows me to send all the data at once on the other sheet.

Let me explain better... hopefully.

The sheet VENDAS contains a list of product and some calculation of subtotals and totals and taxes.
Nothing especial.

Everyday in the sheet VENDAS i will write the quantities of the items my client asked, and i need to send them to the RESUMO sheet to create a list.
So at the end of the month i will have all the sales listed
Like:

date of before yesterday - bread cost - pasta cost - cakes cost - ice cream cost - subtotal of the day
date of yesterday - bread cost - pasta cost - cakes cost - ice cream cost - subtotal of the day
date of today - bread cost - pasta cost - cakes cost - ice cream cost - subtotal of the day
etc.

The script put the data i need in the next empty row in RESUMO.
How to do it without vba?
It is even possible?

You know... all because the guy that uses the workbook forget to enable macros all the time.
Even if i made the first sheet that state: PLEASE ENABLE MACRO BEFORE PROCEED!!!
 
Upvote 0
Please take a minute to reread the forum rules regarding cross-posting and then add the appropriate links (as you did on the other forum). Thanks.
 
Upvote 0
Guilty as charged... sorry about it. I cross posted here
 
Upvote 0
And the other thread on the other board?
 
Upvote 0
Well... they said it cannot be done without vba. ;)
I believe them!
I already got my vba working and i am happy anyway!
 
Upvote 0
Upvote 0
My fault, didn't refresh ? as long as you are happy all good.
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,986
Members
449,058
Latest member
oculus

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