excel

Copy from cell to textbox and maintain all formatting with vba

孤人 提交于 2021-02-11 17:01:39
问题 I need to be able to copy all data entered in a cell and copy it to a textbox. The text is a mixture of different font styles, including colours, bold, italic, and underlined text. The user will then be able to enter more information onto the textbox, using different styles etc. The hope from there is to be able to use vba to copy back to the original cell from the textbox. The rationale is to allow the user to be able to type quite lengthy notes without the constraints of a cell. I am open

VBA Excel border around the picture

ぐ巨炮叔叔 提交于 2021-02-11 16:52:30
问题 Good morning, Precision my question from yesterday: VBA Excel border around the specified picture I would like to make automatic borders for most of the images in my Excel document. I started to record the macro, which looks like this: Sub Picbodred() ' ' Picbodred Macro ' ' ActiveSheet.Shapes.Range(Array("Picture 2")).Select With Selection.ShapeRange.Line .Visible = msoTrue .ForeColor.RGB = RGB(0, 0, 0) .Transparency = 0 End With End Sub But it covers 1 image only, and as it worst this image

Offset the Copy Row as part of a Loop

家住魔仙堡 提交于 2021-02-11 16:51:34
问题 I have written the below code but i would like the macro to repeat this process, copying the next row down in the SS21 Master Sheet until that row is blank (the end of the table). Something like this? Sub Run_Buysheet() Sheets("SS21 Master Sheet").Range("A1:AH1, AJ1:AK1, AQ1").Copy Destination:=Sheets("BUYSHEET").Range("A1") Sheets("SS21 Master Sheet").Range("A2:AH2, AJ2:AK2, AQ2").Copy Destination:=Sheets("BUYSHEET").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) Dim r As Range, i As Long,

Offset the Copy Row as part of a Loop

随声附和 提交于 2021-02-11 16:50:13
问题 I have written the below code but i would like the macro to repeat this process, copying the next row down in the SS21 Master Sheet until that row is blank (the end of the table). Something like this? Sub Run_Buysheet() Sheets("SS21 Master Sheet").Range("A1:AH1, AJ1:AK1, AQ1").Copy Destination:=Sheets("BUYSHEET").Range("A1") Sheets("SS21 Master Sheet").Range("A2:AH2, AJ2:AK2, AQ2").Copy Destination:=Sheets("BUYSHEET").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) Dim r As Range, i As Long,

How do I write this evaluate formula so that the variant doesn't return an error?

◇◆丶佛笑我妖孽 提交于 2021-02-11 16:48:59
问题 I have a formula that works perfectly when used in a With / End With statement for the range: .Formula = "=IFERROR(INDEX(" & MasterDataRange.Address(External:=True) & ",MATCH(" & Cells(iRow, Entry1).Address(True, False) & "&Left(" & Cells(iRow + 1, Entry2).Address(False, False) & ", 4)&""" & wks4.Range("L7").Value & """," & MasterRowMatchRange.Address(External:=True) & ",0),MATCH(""" & header01 & """," & MasterColumnMatchRange.Address(External:=True) & ",0)),0)" When trying to Evaluate the

Autofilter for multiple columns in excel VBA

邮差的信 提交于 2021-02-11 16:17:50
问题 Can you please let check what is the error in below vba macro? Trying to autofilter two columns based on criteria. I am not able to filter field 8 and field 9 based on below code. Worksheets("Demo_Sheet").Activate With Worksheets("Demo_Sheet").Range("A1") .AutoFilter field:=8, Criteria1:="<=" & Format(Now() + 5, "m/d/yyyy"), Criteria2:=">=" & Format(Now() - 5, "m/d/yyyy"), Operator:=xlAnd .AutoFilter field:=9, Criteria1:=">=.95" End With Range("A1").CurrentRegion.Copy 回答1: this gave me an

Read a single cell from Excel to a string using C# and ASP.NET

烂漫一生 提交于 2021-02-11 16:16:39
问题 I need to read a single cell from an xsl excel file to a string withing the web application i am building. I was previously pulling cell ranges from the file to a table using the following code: string PullFromExcell(string CellNo) { string cell; string properties = String.Format(@"Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\Users\User\Desktop\file.xls; Extended Properties = 'Excel 8.0;'"); using (OleDbConnection conn = new OleDbConnection(properties)) { string worksheet = "Sheet";

Pythom:Compare 2 columns and write data to excel sheets

一世执手 提交于 2021-02-11 16:15:42
问题 I need to compare two columns together: "EMAIL" and "LOCATION". I'm using Email because it's more accurate than name for this issue. My objective is to find total number of locations each person worked at, sum up the total of locations to select which sheet the data will been written to and copy the original data over to the new sheet(tab). I need the original data copied over with all the duplicate locations, which is where this problem stumps me. Full Excel Sheet Had to use images because

Pythom:Compare 2 columns and write data to excel sheets

↘锁芯ラ 提交于 2021-02-11 16:12:32
问题 I need to compare two columns together: "EMAIL" and "LOCATION". I'm using Email because it's more accurate than name for this issue. My objective is to find total number of locations each person worked at, sum up the total of locations to select which sheet the data will been written to and copy the original data over to the new sheet(tab). I need the original data copied over with all the duplicate locations, which is where this problem stumps me. Full Excel Sheet Had to use images because

Reading LBR (xml) as TXT in Excel vba

独自空忆成欢 提交于 2021-02-11 15:51:00
问题 I'm trying to read a .LBR extension file (XML language) in Excel with this code: Dim X As Double Dim TXT As String Open "C:\Users\Asus\Desktop\Test\OJE-SS-124HM_000.lbr" For Input As #1 X = 1 Do While Not EOF(1) Line Input #1, TXT Worksheets("LBR").Cells(X, 1) = TXT X = X + 1 Loop Close #1 But I'm getting the entire text just in the first cell A1, see the bottom image. I'd like to get each text lines in separate cells, A1, A2, etc. What am I doing wrong? I think the LBR file doesn't have a