Macros, button that copies data from certain cells into table [Closed]

Report
-
Posts
1292
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
May 7, 2021
-
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

Posts
1292
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
May 7, 2021
230
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.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!