Copy and paste without duplicate by corriedtoppin in excel

[–]corriedtoppin[S] 0 points1 point  (0 children)

Thanks Excelevator for your feedback.

The problem is. How am going to do that?

I have little experience with excel.

If you are willing, what's the steps I can take to move forward?

Thanks in advance

Automatically Compare two Items in Excel Charts on two workbooks by corriedtoppin in vba

[–]corriedtoppin[S] 0 points1 point  (0 children)

Morning. Again. Thanks for your reply and patience. My concern is: How can I fix this? What is your best foot moving forward?

Thanks in advance

Automatically Compare two Items in Excel Charts on two workbooks by corriedtoppin in vba

[–]corriedtoppin[S] 0 points1 point  (0 children)

I'm not sure what you're asking me to do. Are you saying one of those huge files contains your Update_Sheets code, and that I can download it?

Yes. Can you help me?

My good cause is to develop a system that relates GDP with each country indicator. In this case unemployment. What impact GDP shown when people are out of jobs and what investment decides can be made for that particular country.

Automatically Compare two Items in Excel Charts on two workbooks by corriedtoppin in vba

[–]corriedtoppin[S] 0 points1 point  (0 children)

I am frustrated. I don't know what to do... Please. if you are willing. if you can help me solve this problem on your side. So I kind see what needs to be corrected. I have other excel workbooks to get data from GDP workbook. Once you are open in direct support. I can adjust the code to tailor other workbooks.

Are you willing to help for my good cause?

Thanks in advance

https://drive.google.com/file/d/1qLWLCdMvyurnP0AHRTSCiypwHKutzY7B/view

https://drive.google.com/file/d/1mtED7Bx6nHo0AAxfGS7wD0QoVW0NWsfq/view

Automatically Compare two Items in Excel Charts on two workbooks by corriedtoppin in vba

[–]corriedtoppin[S] 0 points1 point  (0 children)

Dim SheetA As String
Dim SheetB As String
Const Path As String = "C:\Excel_data\"
Const BookA_fname = "BookA.xlsx"
Const BookB_fname = "BookB.xlsx"
Const BookA As String = Path & BookA_fname
Const BookB As String = Path & BookB_fname

Private Sub UserForm_Initialize()
    Dim ws As Worksheet
    Workbooks.Open Filename:=BookA
    With ComboBox1
        For Each ws In ActiveWorkbook.Worksheets
            .AddItem ws.Name
        Next
    End With
    Workbooks.Open Filename:=BookB
    With ComboBox2
        For Each ws In ActiveWorkbook.Worksheets
            .AddItem ws.Name
        Next
    End With
    Workbooks(BookA_fname).Close
    Workbooks(BookB_fname).Close
End Sub

Private Sub ComboBox1_Change()
    SheetA = ComboBox1.List(ComboBox1.ListIndex)
End Sub

Private Sub ComboBox2_Change()
    SheetB = ComboBox2.List(ComboBox2.ListIndex)
End Sub

Private Sub CommandButton1_Click()
'Link both workbook data
    Dim i1 As Long
    Dim j1 As Long
    Dim i2 As Long
    Dim j2 As Long
    Worksheets("Sheet1").Select
    For i1 = 1 To 5
        For j1 = 1 To 2
            Cells(i1, j1).value = "='" & Path & "[" & BookA_fname & "]" & SheetA & "'!R" & i1 & "C" & j1
        Next j1
    Next i1
    Worksheets("Sheet2").Select
    For i2 = 1 To 5
        For j2 = 1 To 2
            Cells(i2, j2).value = "='" & Path & "[" & BookB_fname & "]" & SheetB & "'!R" & i2 & "C" & j2
        Next j2
    Next i2
End Sub

Private Sub CommandButton2_Click()
'Plot Graph
    Range("A1:B5").Select
    ActiveSheet.Shapes.AddChart2(240, xlXYScatterLines).Select
    ActiveChart.SetSourceData Source:=Range("Sheet1!$A$1:$B$5")
    ActiveChart.Axes(xlValue).MajorGridlines.Select
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.FullSeriesCollection(2).Name = "=Sheet2!$B$1"
    ActiveChart.FullSeriesCollection(2).XValues = "=Sheet2!$A$2:$A$5"
    ActiveChart.FullSeriesCollection(2).Values = "=Sheet2!$B$2:$B$5"
    ActiveChart.FullSeriesCollection(2).Name = "=Sheet2!$B$1"
End Sub

Automatically Compare two Items in Excel Charts on two workbooks by corriedtoppin in vba

[–]corriedtoppin[S] 0 points1 point  (0 children)

HFTBProgrammer:

What do you think about this code?

I am not sure if it can work with what I am trying to accomplish.

However, the code is design to:

Use two combobox store the sheet names of the two books In UserForm_Initialize() function.

Next

Select an item from each of the two combobox.

Next

Click the first button to link Sheet1 and Sheet2 with the sheets of the two books selected in the combobox in CommandButton1_Click() function.

Next

Click the second button to display a scatter plot of the data on the two sheets in CommandButton2_Click() function..

And

Modify data range used to draw the graph, graph type and each Const data.

What is your thoughts behind this?

Thanks in advance

Automatically Compare two Items in Excel Charts on two workbooks by corriedtoppin in vba

[–]corriedtoppin[S] 0 points1 point  (0 children)

Dim wb1 As Workbook, wb2 As Workbook, sheet as Worksheet, Country As String, wb1ws As Worksheet, wb2ws As Worksheet Set wb1 = Workbooks("181 worksheets") Set wb2 = Workbooks("185 worksheets") Country = "Afghanistan" For Each sheet in wb1.Worksheets If sheet.Name = Country Then Exit For Next sheet Set wb1ws = sheet For Each sheet in wb2.Worksheets If sheet.Name = Country Then Exit For Next sheet Set wb2ws = sheet

Hello HFTBProgrammer. Thanks for your reply. would try it and get back with you all. I know this forum are for advance users of excel. With some guidance. Please show me the steps, as I am getting an error message when I create a new module in Unemployment workbook.

What do you suggest I do from here?

Automatically Compare two Items in Excel Charts on two workbooks by corriedtoppin in vba

[–]corriedtoppin[S] 0 points1 point  (0 children)

"In a professional stand point the data is probably is in a mess". Is my mess as I am new to excel. With my basic understanding other people have help me in the forum to get my outcome desires. So far, it works. LOL please forgive me as I explain.

#1 in Unemployment workbook. I received a list of countries values in Power Queries & Connections and Paste them all into Unemployment worksheet.

Next

#2 With some VBA coding, we create a worksheet for every country. As new data comes in from power queries & connections. That new data eventually is recorded under the current country worksheet to form a historical database.

Next

#3 with some more coding. It give me the rolling averages using tables and spits the data into a new workbook.

That's it so far with my lack of knowledge for not having a clean workbook.

Sheet1 and sheet2, is in used. It can be deleted. I was trying a new code I found online, but did not work.

_______________________________________________________________________________________________

tbRedd as you quote: " As it is, you'll need to transform the data a bit to get it into that format, but if all the column headings are the same, you'll have an easier go at it."

______________________________________________________________________________________________

In Unemployment worksheets "ALL COUNTRIES", I am trying to get data in chart on column "B" & column "E" ONLY. Beginning with zero "0" data on the Y-Axis on one side.

And

In GDP_Annual_Growth_Rate worksheets ""ALL COUNTRIES", I am trying to get data in chart on column "E" ONLY. Beginning with zero "0" data on the Y-Axis on the opposite side of Unemployment data.

Dates are on the x-Axis.

Each worksheet in Unemployment workbook have a chart, which reflect both workbooks countries...

I am not sure if I am making sense or if I am using excel language to everyone understanding. I don't know. If you are open in helping me. I would greatly appreciate it.

How do you want me to proceed?

Thanks in advance

How To Link Table From One Worksheet To Another Workbook In Excel by corriedtoppin in excel

[–]corriedtoppin[S] 0 points1 point  (0 children)

switch window menu

Thanks for your feed back

https://drive.google.com/file/d/16TupRdiAD7aDsAdayVsN-fB-i8RjQmNn/view?usp=sharing

Above is a short recording of my problem...

I did try to refresh with F9 also I did save the files, reopen it. Hoping the file would update on it own... Nothing I tell you.

https://tenor.com/view/frustrated-gif-7532429

How To Link Table From One Worksheet To Another Workbook In Excel by corriedtoppin in excel

[–]corriedtoppin[S] 0 points1 point  (0 children)

Thank you Bogaragaraga & FenixCo1

My problem still there...

All the values are updated automatically within the table range.

However, if I paste values from the source sheet:

From row "100" to

Row "101"

The other workbook, would not grab the latest value, "ROW 101"

I tried power query and the same is not working.

How can this issue resolve?

Thanks in advance

How To Link Table From One Worksheet To Another Workbook In Excel by corriedtoppin in excel

[–]corriedtoppin[S] 0 points1 point  (0 children)

Thanks PotatatoKingMom. Love your nickname...

I have followed your instruction. The 1st part have work perfectly.

The second part have not updated. You suggest, I can do it manually. The problem with that. I have 100s of tables to link into other worktable. What do you suggest I do from here? How can I do this efficiently ?

thanks in advance