Code Adjustment To Copy And Paste Bold Text And Border?
Aug 13, 2014
Is it possible to modify the attached code so that it will copy bold text and border as shown in attachment sample1 and paste in sheet Shop. Currently the code just copy's and pastes without bold text and borders.
I want text that's in bold in column B in sheet 1 of my spreadsheet to copy over into column A in sheet 2 of my spreadsheet - is there a quick way of doing this using code or a formula?
when "Update"(code is under "Update"button) button is pressed to copy the data from userform to the database sheet exactly into columns where both column heading match, for example if userform has heading "Qty Received " all data from that column should be in the database column with the same header "Qty Received"
I attached my file when you will open the file you will find screenshot how it should look.
After using Copy/Pastespecial in my macro, when it completes I have the flashing border around the range that was copied, (like you do when you do it manually). What line of code do I need in my macro to make this go away?
I have a spreadsheet with a pivot table in it. Column "G" has all of the data in it I need to abbreviate, problem is, I only want the values in BOLD face, and there are 3-5 rows seperating each boldfaced item. I would have to manually copy-paste each bold value into a new, 'clean' column ( column "I", or in a new sheet/workbook, it doesn't matter), and lather-rinse-repeat for the next 700+ rows. It sucks. No, it really does. I stumbled upon this website which is seemingly the utopia for excel macro and programming problems, so is there anyone out there that might take the time to walk me through it...?
I want to have a function or macro that if cells have mingled bold text, that only the bold text shall remain in the cells, and all the rest of the text must be deleted.
The code below puts a green border around the cell that is beneath 10 in my chosen range, however I wish to add the border to the row of information instead of just the cell. My columns of data are from columns E to M, but the criteria for whether or not the data gets a green border is in column D....so lets say D15 is less than 10, I would want a border to go around E15:M15.
Sub Test() For Each c In Range("D2:D350") If c < 10 Then c.select With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 4 End With
I've adjusted a jonmo code to add an item in col B which is not in col A to the bottom of col A. - fab code, thanks jonmo.
But.. i want to:
insert rows beneath those in column A to accommodate the added items and shade those cells in list A once they been added ( so the users now they've been moved )
I've posted the code below ( including my attempts at colour change where it shade the right cell but in the wrong column ) ...
I am merging columns. Col B has all text in bold. Col C has all text in regular font. When I use ASAP to merge, the merged column comes out all bold. When I use a formula to merge the merged column comes out all regular. What I want is for the merged column to contain the bold text from Col B in bold, and the regular text from Col C in regular.
What I want is...
This is for service plan B: Take all data and transer to new server.
What I am getting is...
This is for service plan B:Take all data and transer to new server.
OR
This is for service plan B:Take all data and transer to new server.
I have two files and need to copy the information from columns B,C,F,H rows 5 true 29, and past it in the other file in Columns B,D,G,J; rows 3 true 35.
The code that I have works fine, but have one problem - it past the info in the rows starting from 37 instead from row 3. Here is where I need your help. The code is triggered when the condition Arr ( arrived) is chosen in the column AH ( file Delivery Status) and then the specific warehouse is chosen in the column AI. To make it easy I have left only one warehouse as a choice.
Attached you can find sample files ( I have delete the info from the heading cells as it was in another lenguage)
I created this spreadsheet a few montsh ago to help with forecasting for my companies products. The tabs of interest are the HIST vs FORECAST, FORECAST TOOLKIT, and the FORECAST TABLE tab – now the FORECAST TABLE tab is always hidden and if you unhide it then it will rehide itself once one of the macro’s is run. I set it that way to prevent people accidently making adjustments to the forecast data.
The way the sheet is supposed to run is that when you are on the hist vs forecast page then you can click one of the grey buttons on the right which will then graph the numbers for the relevant product on the toolkit page – so far so good, this bit all works fine, there are separate macro’s for this each named after the product they control.
Then once you are on the toolkit you can play about with the numbers until you come up with a 6 month forecast you are happy with which will be on the 6 cell line in the bottom right were it says “ IMPORT”. You can then click on the “IMPORT” button which will then copy and paste it back into the forecast table under the relevant setting – the macro for this is called IMPORT2 and it works off a “product” range and a “ date” range – again this pretty much works as intended.
Sub IMPORT2() Dim nDate, nProd With Sheets("Forecast Toolkit") nDate = Application.Match(.Range("O31"), Range("Dates")) + Range("Dates")(1).Row - 1 nProd = Application.Match(.Range("I3"), Range("Products")) + Range("Dates")(1).Column...........................
The below code adds a line to the next blank row. I would like to add a border to this row that the values are going into. Columns "A:G"
Code:
Private Sub CMD_Add_Click() Dim rNextCl As Range Set rNextCl = Worksheets("Main").Cells(Rows.Count, 2).End(xlUp).Offset(2, 0) Worksheets("Main").Activate rNextCl.Select Dim iRow As Long
I'm new to VBA and needed help with: I need to 'bold' the row which contains sum, the problem is that the location of the row varies depending on how long/short the report is.... Here is the code I used to bold a particular row:
Range("A14").EntireRow.Font.Bold = True
But instead of A14, i need it to be a row of no more than 5 columns, one of which contains the word 'SUM'.
I'm using code that SHG provided for me here; http://www.excelforum.com/excel-programming/630464-sheet-macro-for-preventing-paste-not-working.html
It worked great in the first workbook I set up but I just set up a new workbook and it's not doing the same thing. For example, it allows me to copy items from column A which have 1 type of validation (restriction on text) to another column which has a formula validation.
It still won't allow me to paste from outside a validated range to inside but I need to prevent people from screwing up the validation between columns.
I have the following bit of VBA code which copies a particular cell and pastes it in the next available cell in column "AD", but I need to paste it as a value. How do I incorporate this into the code?
Sub copypaste() Worksheets("USD IR Swap 10 Yr").Range("L5").Copy _ Destination:=Worksheets("USD IR Swap 10 Yr").Cells(Worksheets("USD IR Swap 10 Yr") .Rows.Count, "AD").End(xlUp).Offset(1, 0) End Sub
I am looking for VBA code that will select a data validation cell, copy the selection, and paste the value of that cell in a different worksheet.
The data validation list is in cell L47. The user will select a date from cell D31, type a description of activities in the adjacent column and then select initials from the aforementioned validation list in cell L47. I need the code to fit into a button I created so that when they click it to approve the activity, the code will copy the value of the initials and paste it into column AB in a separate worksheet. Column AB runs parallel to column A, which contains all of the dates located on Sheet1 in cell D31. I think I might need some sort of loop to run this so that it pastes initials on the correct date.
I want to automate the transferring of specific pieces of data from one spreadsheet into another spreadsheet. There are many project spreadsheets that all feed into a resource plan spreadsheet showing every employee, what projects each of them are on, and how many hours they are spending on each project for the quarter.
Now what I would like to do is to automate this process of feeding the data from the many project spreadsheets into the resource plan spreadsheet. With transferring the specific data from the one to the other. Basically I need it so that excel looks at the project spreadsheet copies the name of the employee and the hours they have worked each week for the quarter and paste It into the big resource plan. What I am finding tricky is knowing how to make it automatically paste into the right area as in copy an employee and paste the details in the same employees cells in the other spreadsheet.
part of my code looks like this. Instead of it being if c.interior.colorindex i want it to be if top border color = 4.
How do i syntax this?
For Each c In Worksheets("Sheet1").Range("B7:DE7").Cells If c.Interior.ColorIndex = 4 Then Range("DH7").Value = Range("DH7").Value + c.Value Also, is there a way to specify Range("DH") and make the row be the current row, not hard coded to 7
i'm using the following code to make a selection bold or not (basically as a replacement for the bold button). It works fine unless you select a group of cells...some of which are already bold and some of which are not...in this case it doesn't work....here is the code
I have 4-5 worksheets (sheet1,sheet2,etc) on a workbook. All of the rows except for the ones that are filled in are currently HIDDEN.
I have one worksheet called "Add record" which has a VBA code that adds a record to any of these sheets.
When it does this I want it to recognise when pasting the new record into any fo the sheets.. IF the row is hidden, the sheet needs to reveal that row.
I'm desperate trying to get this to work!!
Here is the code I have so far! This is a command button macro used in the "Add Record Sheet" I have FOUR different versions of this code. Each one adds the data to a specific sheet.
I would like a code which looks on the worksheet “Racks” and if Column A is "Y" then copy the entire row and paste it on the to sheet “Summary Racks”. I would need it to then find the next instance and then continue to copy and paste. I have attached the file I am currently working on.
I have this code that copy/pastes a range from another sheet for every nth row. In the code I have pasted cells I need to merge the cell with the cell to the right and format it. I thought I was doing ok but the code keeps returning an error (run-time 1004) and I don't know the solution, it is beyond my level of VBA.
Code: Sub test() Dim ws1 As Worksheet Dim ws2 As Worksheet Dim lngRowCounter As Long Dim newRowCounter As Long
[Code] ...
The code in red is the problem and I have commented it out so it can run, but I need it to merge and format. I don't know how to address range/cells in column B and C together (they are the two cells I wish to merge and format).
I use for another template and it works fine. Only change I would like to make is the column headers starts in Row 4. Col B. Some how this is not working for me.
Sub ITD_REV()
Application.ScreenUpdating = False
With Sheets("Data").Rows("1:1") Set c = .Find("CONTRACT #", LookIn:=xlValues) If Not c Is Nothing Then FirstAddress = c.Address Do c.EntireColumn.Copy Sheets("Test1").Select Range("B3").Insert shift:=xlRight Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address FirstAddress End If End With End Sub
Again...incase what I said does not make sense: I want to copy certain columns with fixed header names, e.g. "CONTRACT #" into another sheet name "Test1" and paste starting into cell B3. Another column would be "Contract Name" and so on. Also, these col header names may not be in order. In "Data" sheet, col header names starts in row 4.