Help macro copying specific columns from one workbook and paste value .... in another workbook again in specific columns

K0st4din

Active Member
Joined
Feb 8, 2012
Messages
488
Office Version
  1. 2016
  2. 2013
  3. 2011
  4. 2010
  5. 2007
Platform
  1. Windows
Hello everyone,
I need your help on a macro to perform the following:
I have a main file (database)
in different folders have monthly excel files
1 I have USERFORM, there I have buttons.
2 Is it possible to make a macro that put it in my selected button that:
pressing it - opens the menu and navigate it alone file from which to copy the information
3 Can you ensure that the information in column B4: to include text -> to put in column C (paste value)(below the last text that is in it and be cumulative (do not want to delete the previous information)) in database file
4 Can you ensure that the information in the column F4: to include text -> to put in column E (paste value)(below the last text that is in it and be cumulative (do not want to delete the previous information)) in database file
5 Can you make sure that information from the column I4: to include text -> to put in column I (paste value)(below the last text that is in it and be cumulative (do not want to delete the previous information)) in database file
6 Can you ensure that the information in column M4: to include text -> to put in column H (paste value)(below the last text that is in it and be cumulative (do not want to delete the previous information)) in database file
7 Can you ensure that the information in column O4: to include text -> to put in column J (paste value)(below the last text that is in it and be cumulative (do not want to delete the previous information)) in database file
8 Close the file from which we get the information and are still open database file.
I would be very grateful if you could help me with this macro.
Be healthy
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hello,
that could be resolved or there is something not understood in my query?
I really need your help.
 
Upvote 0
Hello colleagues,
really no decision to make such a macro?
Or not understood my request.
I wrote in my first request, if you will attach some sample tables.
Thank you once again
 
Upvote 0
Hello again,
reread what I wrote as asking at one point I thought May was a bit confusing.
So please be excused if I had not been understood.
Everything I've done userform and also the buttons, but can not do macro for it ask for your assistance.
Thank you very much
 
Upvote 0
Hello
something must be macro.
Really nobody can help me?
You helped me so many times, and not only to me with much more complex macros.
Please help my friends.
I tried to do it alone macro, but do not get things to me.

Code:
Sub Macro1()'
' Macro1 Macro
'


'
    ChDir "C:\my parth"
    Workbooks("my workbook.xls").Connections.Add "Connection", "" _
       
    Workbooks.Open Filename:= _
        "C:\file from copy.xls"
    Range("F2").Select
    Range(Selection, Selection.End(xlDown)).Select
    ActiveWindow.SmallScroll Down:=8
    Selection.Copy
    Windows("file to paste.xlsm").Activate
    Range("C82993").Select [COLOR=#008000]'must be next empty cell[/COLOR]
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("file from copy.xls").Activate
        Range("G2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("file to paste.xlsm").Activate
        Range("E82993").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("file from copy.xls").Activate
    Range("C2103").Select
    Selection.End(xlUp).Select
    Range("C2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("file to paste.xlsm").Activate
    Range("H82993").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("file from copy.xls").Activate
    Range("I2103").Select
    Selection.End(xlUp).Select
    Range("I2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("file to paste.xlsm").Activate
        Range("J82993").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("file from copy.xls").Activate
    Application.CutCopyMode = False
    ActiveWindow.Close
End Sub
 
Last edited:
Upvote 0
K0st4din,

Reading your post, I have kind of an idea of what you are asking

First which version of Office are you using.... 2007, 2010, 2013.

Second, please post the sheets, copy.xls and file to paste.xslm, so that I can see them in relation to your code segment. Replace private infomation with bogus info, but please supply some data in your sheets.

Third, exactly what is the problem you are having with the macro as you have coded.

What is it doing?

What is it not doing?

cplmckenzie


 
Upvote 0
K0st4din,

Reading your post, I have kind of an idea of what you are asking

Hello,
I want to copy information from an excel file in my main excel file accumulation (ie in already accumulated information to put new information into old information)

First which version of Office are you using.... 2007, 2010, 2013.

I use excel 2007, 2003, 2010 -
mention a few, because at home I use one type excel in my work another version of excel, so do not think that version is very important

file format that I get in .xls, and file when I save it in a format .xlsm


Second, please post the sheets, copy.xls and file to paste.xslm, so that I can see them in relation to your code segment. Replace private infomation with bogus info, but please supply some data in your sheets.

Link to download 2 files

Third, exactly what is the problem you are having with the macro as you have coded.

The problem I can not say it, because I can not do it alone macro, but I know it should be (or more accurately starts) in some such form:
Code:
f = Application.FindFile[FONT=arial]
[/FONT]
    If Not f Then Exit Sub ' no file selected

so that I alone to navigate and select the file that I want

Thanks in advance for any help
 
Upvote 0
The files from the download link are not useable Excel worksheets. I suggest you post the Excel worksheets here in your thread in order to get some assistance with your issue. cplmckenzie
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,739
Members
449,050
Latest member
excelknuckles

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