Macros, button that copies data from certain cells into table

Closed
Bex - May 10, 2015 at 03:10 PM
vcoolio
Posts
1345
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
May 20, 2022
- May 11, 2015 at 05:25 AM
Hello,

I am trying to create a "database" table on one sheet to record data that was calculated on another sheet. The issue is the data calculated is on 5 different cells that do not match the table cells. Basically i'm gathering info from 5 random cells and organizing it into a table on the next sheet. I want a button to do this (as opposed to a formula) because the calculations change every day.

Thank you!

1 reply

vcoolio
Posts
1345
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
May 20, 2022
249
May 11, 2015 at 05:25 AM
Hello Bex,

You'd best upload a sample of your work book so that we can see exactly what it is that you want to do. The following basic code will copy random cells from sheet 1 to sheet 2:-

Sub CopyValues()

Application.ScreenUpdating = False

    ActiveCell.Copy
    Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
    
Application.ScreenUpdating = True
Application.CutCopyMode = False
Sheets("Sheet2").Select

End Sub


but it will only place them one beneath the next in sheet 2.

Do you have an entire row of data to transfer over with the random cell value?

You can upload a sample of your work book using a free file sharing site such as DropBox or ge.tt

Cheerio,
vcoolio.
0