+ Reply to Thread
Results 1 to 7 of 7

VBA : Input form : Copy column and paste special value in another column

  1. #1
    Registered User
    Join Date
    09-03-2023
    Location
    london
    MS-Off Ver
    16
    Posts
    6

    VBA : Input form : Copy column and paste special value in another column

    Hello

    I'm quite new to VBA .
    I'm trying to do a Input form with VBA

    I have 3 sheets

    Sheet1 : Input
    Sheet 2 : Sheet3
    Sheet 3 : Cal

    I have two macros which work with a insert button :

    Sheet1 = Input - Sub OneCell()
    Sheet2 = Sheet3 - Sub ok()


    Sub OneCell()

    Sheets("Input").Range("c3:c9").Copy Sheets("Sheet3").Range("b3:b9")
    Sheets("Input").Range("c3:c9").ClearContents


    End Sub

    and


    Sub ok()

    Sheets("Sheet3").Range("c3:c9").Copy

    Sheets("Cal").Range("c3:c9").PasteSpecial Paste:=xlPasteValues

    Sheets("Sheet3").Range("b3:b9").ClearContents

    End Sub


    For the Macro Sub ok()


    I would like to have the same code but which will paste the value in the the following empty columns in Sheet Cal

    such as pasting the values starting in c3:c9 then pasting the following values in d3:d9 and so on


    Is what something possible ?

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: VBA : Input form : Copy column and paste special value in another column


    Hello,

    as the attachment is missing : is there something at least in columns A:B ?
    Last edited by Marc L; 09-04-2023 at 11:01 AM.

  3. #3
    Registered User
    Join Date
    09-03-2023
    Location
    london
    MS-Off Ver
    16
    Posts
    6

    Re: VBA : Input form : Copy column and paste special value in another column

    Hello Marc ,

    Thank you for your feedback.
    I cannot seem to be able to attach file

    Yes , there is .

    In Sheets("Cal")
    Column A is my Parameters Column (A2:A9)

    Column B is my Weightage (%) Column (B2:B9)

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: VBA : Input form : Copy column and paste special value in another column


    Follow top page yellow banner to attach your workbook …

  5. #5
    Registered User
    Join Date
    09-03-2023
    Location
    london
    MS-Off Ver
    16
    Posts
    6

    Re: VBA : Input form : Copy column and paste special value in another column

    [
    Hi Marc ,

    Thanks for the feedback.

    I have attached the excel sheet
    ATTACH]841697[/ATTACH]
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !


    According to your attachment :

    • first in Cal worksheet select all columns after column B then delete them all.

    • As only a single VBA procedure is necessary so you must delete entirely the content of Module1
      then paste this starter VBA demonstration - you can rename it - then allocate it to both worksheets buttons :

    PHP Code: 
    Sub Demo1()
       
    With Sheet3
              C
    % = .UsedRange.Columns.Count 1
             
    .[B2].Copy .Cells(2C)
             .
    Cells(2C) = "Supplier " 2
        With 
    .Cells(3C).Resize(7)
             .
    Borders.Weight 2
             
    .HorizontalAlignment xlCenter
             
    .Value2 = [C3:C9].Value2
        End With
             
    .Columns(C).AutoFit
       End With
            
    [C3:C9].ClearContents
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 09-04-2023 at 08:15 PM.

  7. #7
    Registered User
    Join Date
    09-03-2023
    Location
    london
    MS-Off Ver
    16
    Posts
    6

    Re: VBA : Input form : Copy column and paste special value in another column

    Tip Top Marc . It fits perfectly . Thank you for your patience
    Have a nice evening

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy and paste column with special formatting
    By xbr088 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2022, 09:47 AM
  2. Replies: 14
    Last Post: 09-05-2017, 11:32 AM
  3. [SOLVED] Copy Paste Special Using Column Headers
    By phelbin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2016, 02:19 PM
  4. column E copy/paste special values
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2015, 06:03 PM
  5. [SOLVED] No experience, special copy and paste column macro
    By shuynh84 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-31-2014, 01:10 PM
  6. [SOLVED] Copy Special Paste in the same column
    By iwilli in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2012, 03:38 PM
  7. Macro to copy and paste special values for column data and filter column data
    By ascottbag in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-10-2012, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1