excel-vba

Excel VBA requiring file extension for workbook reference in some systems

假装没事ソ 提交于 2020-07-01 06:10:41
问题 I have a simple excel VBA that is referring multiple files and copying information across to a master before processing. While building this on my own system a workbook reference (working perfectly fine) was written as: Workbooks("key").Sheets("Sheet1").Range("A1:X57").Copy Here key is a .xlsx file While using this in another system this does not work and it explicitly requires the file extension in every call. Workbooks("key.xlsx").Sheets("Sheet1").Range("A1:X57").Copy It would not be

Excel VBA requiring file extension for workbook reference in some systems

落花浮王杯 提交于 2020-07-01 06:09:11
问题 I have a simple excel VBA that is referring multiple files and copying information across to a master before processing. While building this on my own system a workbook reference (working perfectly fine) was written as: Workbooks("key").Sheets("Sheet1").Range("A1:X57").Copy Here key is a .xlsx file While using this in another system this does not work and it explicitly requires the file extension in every call. Workbooks("key.xlsx").Sheets("Sheet1").Range("A1:X57").Copy It would not be

Copy/Paste Special loop in VBA

雨燕双飞 提交于 2020-06-29 11:47:49
问题 Very new to VBA and trying to do a simply copy/paste special loop. How would you write the code so that each time it loops it copies one cell down in the Filter Out Pitchers tab and pastes special one cell down in the Batter Comparison tab? Sub Hitters() For i = 1 To 500 Worksheets("Filter Out Pitchers").Range("B2").Copy Worksheets("Batter Analysis").Paste _ Destination:=Worksheets("Batter Analysis").Range("B1") Worksheets("Batter Analysis").Range("A88:AA88").Copy Worksheets("Batter

Copy/Paste Special loop in VBA

旧城冷巷雨未停 提交于 2020-06-29 11:47:23
问题 Very new to VBA and trying to do a simply copy/paste special loop. How would you write the code so that each time it loops it copies one cell down in the Filter Out Pitchers tab and pastes special one cell down in the Batter Comparison tab? Sub Hitters() For i = 1 To 500 Worksheets("Filter Out Pitchers").Range("B2").Copy Worksheets("Batter Analysis").Paste _ Destination:=Worksheets("Batter Analysis").Range("B1") Worksheets("Batter Analysis").Range("A88:AA88").Copy Worksheets("Batter

How to ignore “name XXX already exists” messages when moving sheets in excel VBA

佐手、 提交于 2020-06-29 11:07:20
问题 I am trying to copy from one workbook to another but get a message as I move the sheet that a name already exists. is there a way to automatically ignore this message? The message is: is: the code for the copy CurrentWorkBook.Sheets(Array("Compliance - learning")).Copy Before:=ActiveWorkbook.Sheets(1) 回答1: I think you are looking for Application.DisplayAlerts = False CurrentWorkBook.Sheets(Array("Compliance - learning")).Copy Before:=ActiveWorkbook.Sheets(1) Application.DisplayAlerts = True

Copying a range from all files within a folder and pasting into master workbook

与世无争的帅哥 提交于 2020-06-29 10:50:35
问题 I'm fairly new to VBA so I apologize ahead of time. I've been getting involved with some complex operations and I would greatly appreciate some help or input. With this macro, I am trying to: Copy a specific range (2 column widths) from a specific sheet that is within all files in a given folder. Paste the range values (and formatting if possible) in a column on the already open master workbook starting at B7 and moving over 2 columns for every new document so that the pasted data does not

Excel searchable data validation dropdown lists

删除回忆录丶 提交于 2020-06-29 10:35:38
问题 There are two ways to make drop down list in Excel: Data validation list Combobox form control Now in my project I have Data validation dropdown lists wich can be too long and I want to add search functionality for it. I've find some solutions but only for combobox control, which not applicable for my Excel document, because theese dropdown lists should be repeated in each row: Is there any possible solution to add search functionality to datavalidation dropdown list? 来源: https:/

How do I make VBA wait for IE page to load?

牧云@^-^@ 提交于 2020-06-29 09:56:38
问题 I am automating IE through VBA and I can't seem to get the VBA code to wait until the page is loaded before grabbing the document. This is leading to all sorts of failures with my code being too fast. How can I get VBA to wait for the IE page to load? Many of the methods I have tried I have found on stackoverflow but none seem to work for me. ie is my InternetExplorer object. I have tried, to no avail: Do If ie.readyState = 4 Then Exit Do Else DoEvents End If Loop Also: Do While ie.Busy Or

Excel VBA How to multiply range by one number [closed]

冷暖自知 提交于 2020-06-29 09:41:04
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . Improve this question I am very new to VBA and I am seeking help to solve the following problem. I need to multiply a range by a single number. All of the cells with in that range need to be multiplied by that one number. Thank you! 回答1: As what I comment just now. 1.Enter the formula at the cells

Excel VBA How to multiply range by one number [closed]

久未见 提交于 2020-06-29 09:40:32
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . Improve this question I am very new to VBA and I am seeking help to solve the following problem. I need to multiply a range by a single number. All of the cells with in that range need to be multiplied by that one number. Thank you! 回答1: As what I comment just now. 1.Enter the formula at the cells