vba

'28' Out of Stack Space. Worksheet_Change and Application.ScreenUpdating

隐身守侯 提交于 2021-02-08 08:06:30
问题 thanks in advance for any clarity you can offer. In an Excel Workbook with many modules and worksheets, at the bottom of the VBA code for SHEET2, there is this Subroutine: Private Sub Worksheet_Change(ByVal Target As Range) Dim TargetCells As Range Set TargetCells = Range("B1000:B1029") If Not Application.Intersect(TargetCells, Range(Target.Address)) Is Nothing Then Call SpecificSubRoutine End If End Sub My understanding of this code is that it watches the entire sheet for ANY changes. If

UDF works in VBA, returns #REF! in workbook

陌路散爱 提交于 2021-02-08 08:03:19
问题 I wrote a function that calculates the sales for 2014 for the specific worksheets inside the workbook, then prints the total sales for 2014 in a specific cell. I can call the function inside of VBA, no issue. But if try to use the function in the workbook, I get a reference error. I know #REF! means the formula refers to a cell that isn't valid, do I need to be returning some kind of value into the cell that I am trying to call the function into? For example, if I type sum2014("A1151") into

SFTP upload in VBA

我们两清 提交于 2021-02-08 07:58:27
问题 Dode below doesn't return an error, or "success" or "fail" but it also doesn't work - information in the sub TestUpload that is CAPITALIZED is the only info that i changed to make this post - everything else is legit - thanks in advance. Option Compare Database Private Const FTP_TRANSFER_TYPE_UNKNOWN As Long = 0 Private Const INTERNET_FLAG_RELOAD As Long = &H80000000 Private Declare Function InternetOpenA Lib "wininet.dll" ( _ ByVal sAgent As String, _ ByVal lAccessType As Long, _ ByVal

VBA: Checked checkboxes in array of groupboxes

核能气质少年 提交于 2021-02-08 07:28:29
问题 I am running a sub where I need to count the number of checked checkboxes in a groupbox and do this for several groupboxes. Edit: I forgot to mention I am using form controls and not ActiveX controls. My first issue is creating an array of group boxes. I tried using GB_Array = Activesheet.Shapes.Range(Array(Cells(x, y), Cells(z, y))) ' x,y,z defined elsewhere I can make that work by manually adding, but it isn't ideal. My second issue is with this part: Option Base 1 Dim cbox as Checkbox Dim

How do i extract merged data and put them into different worksheets?

那年仲夏 提交于 2021-02-08 07:26:14
问题 How do i use excel vba to extract merged data selectively(not manually clicking and copying from the excel sheet and also not specifically listing the range of the data that i want to copy. What i want is in a way such that the programme extract the entire row that has the same type of name from column F to column H for example Martin_1,Martin_2 and Martin _3 respectively for different names(John, Charlie) and copy and paste them to a new worksheet. Put the extracted data into 3 different

Can I use API or something else to get close to a TRUE RANDOM NUMBER in VBA?

自闭症网瘾萝莉.ら 提交于 2021-02-08 07:26:12
问题 Is there an API, library, or some other chip-set based command I can access in VBA? I currently have a setup for getting random numbers; however, when I put the result sets to the test, the numbers do not even come close to generating a good statistical curve. I tested this by generating 600 simulated rolls of 2 six-sided dice totaling the 2 dice together each time. I was hoping for the number 7 to take a huge lead; however it came in second twice with nowhere near the appropriate statistical

How do i extract merged data and put them into different worksheets?

孤街浪徒 提交于 2021-02-08 07:24:01
问题 How do i use excel vba to extract merged data selectively(not manually clicking and copying from the excel sheet and also not specifically listing the range of the data that i want to copy. What i want is in a way such that the programme extract the entire row that has the same type of name from column F to column H for example Martin_1,Martin_2 and Martin _3 respectively for different names(John, Charlie) and copy and paste them to a new worksheet. Put the extracted data into 3 different

Can I use API or something else to get close to a TRUE RANDOM NUMBER in VBA?

一笑奈何 提交于 2021-02-08 07:23:52
问题 Is there an API, library, or some other chip-set based command I can access in VBA? I currently have a setup for getting random numbers; however, when I put the result sets to the test, the numbers do not even come close to generating a good statistical curve. I tested this by generating 600 simulated rolls of 2 six-sided dice totaling the 2 dice together each time. I was hoping for the number 7 to take a huge lead; however it came in second twice with nowhere near the appropriate statistical

Can I use API or something else to get close to a TRUE RANDOM NUMBER in VBA?

我只是一个虾纸丫 提交于 2021-02-08 07:22:09
问题 Is there an API, library, or some other chip-set based command I can access in VBA? I currently have a setup for getting random numbers; however, when I put the result sets to the test, the numbers do not even come close to generating a good statistical curve. I tested this by generating 600 simulated rolls of 2 six-sided dice totaling the 2 dice together each time. I was hoping for the number 7 to take a huge lead; however it came in second twice with nowhere near the appropriate statistical

VBA download form URL with login that redirect to another one

删除回忆录丶 提交于 2021-02-08 07:20:37
问题 the website requires login then redirect you to other url then download the file this function works fine with url with no redirction but not with my case Function DownloadFile(URL As String, Path As String, UserName As String, Password As String) As Boolean DownloadFile = False Dim WinHttpReq As Object Set WinHttpReq = CreateObject("MSXML2.ServerXMLHTTP.6.0") WinHttpReq.Open "GET", URL, False, UserName, Password WinHttpReq.send Set oStream = CreateObject("ADODB.Stream") oStream.Open oStream