Posts by falak


    What i am trying to code is

    -Uploading the data from browser and pasting it Masterfile attached below by button name "Upload POD"

    - As both the workbooks have a same column name "PO" so while pasting it should be pasted into the respective row where that "PO" in the master file is location

    As for example In Masterfile B5 has PO of "2" so when uploading the document having Proof data occurs the value mentioned in PO of "2" in file Purchase should be paste corresponding row5 in POD columnE , the value against PO number 2 is 3rd Jan

    - I just basically wants to update the data by matching its PO numbers

    Note: Every row will have a different PO, so not really any chances of over-driven data

    for reference here is the code im using to upload data at first place mention in the macro of "UploadData"


    Sub upload_data()

    Dim WScopy As Worksheet, WSdest As Worksheet, desWB As Workbook, FileToOpen As Variant, cRow As Long

    Set desWB = ThisWorkbook

    Set WSdest = desWB.Sheets(1)

    Application.ScreenUpdating = False

    FileToOpen = Application.GetOpenFilename(Title:="Browse for your file & Import Range", FileFilter:="Excel Files (*.xls*),*xls*")

    If FileToOpen = False Then Exit Sub

    Set OpenBook = Application.Workbooks.Open(FileToOpen)

    With Sheets(1)

    cRow = .Cells(Rows.Count, "A").End(xlUp).row

    .Range("A4:H" & cRow).copy

    WSdest.Cells(WSdest.Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValuesAndNumberFormats

    End With

    ActiveWorkbook.Close False

    Application.CutCopyMode = False

    Application.ScreenUpdating = True

    End Sub

    Give this a try:

    One thing i further noticed that its not working till the end row until I upload some data from either same or different workbook. As soon as the data is filled twice columnI is calculated for the previous uplaoded data


    Sorry but its still the same! its only getting calculated for just firts 2 rows in ColumnI

    Give this a try:

    This is just working first 2 rows not until the last row having the data

    Column I was included in the range that was copied from the file that was opened. If you insert the formula in column I, whatever is already in column I that was copied over will be replaced with the formula. Is that what you want to do?

    I want the answer in Colum I. There isnt anything in Column I before or after the upload. Column I was not included in the range that was copied from the file that was opened.

    I'm not sure what you mean by the following:

    Please clarify in detail step by step what you want to do referring to specific cells, ranges, sheets and workbooks.

    SO bascially what i want to do it

    - After uploading the data into Masterfile

    - I want to calculate the percentage (Column I) and the formula would be " ColumnG/(ColumF - ColumnH)*100"

    - I want this to calculate automatically once the data is uploaded and it should be calculated till the lastrow having the data

    Hello! I am new to excel-vba programming. So basically Im trying to browse a file from the computer and COPY Data from that SELECTED File in Excel using vba, Im trying to select data from filled rows available in the selected excel workbook and paste it below existing data in the desired destination workbook here as "Masterfile.xlsm",

    Can anyone PLEASE help me find errors here, suggestions to code in a better way are open.;(;(;(;(;(;(