我想问一下您在Excel中定义命名范围的经验。
我通常使用以下公式:
=OFFSET(Sheet!$A$1;0;0;COUNTA(Sheet!$A:$A);COUNTA(DATA!$1:$1))
这对于动态范围非常有用。一旦将行或列添加到原始表中,它将进行修改。在这种情况下,一旦在A列或第1行的表外输入了一些数据,就会出现问题。
然后,我认为UDF中的Range("A1").CurrentRegion.Address
可以胜任。但是,我猜想在UDF中会跳过此命令...因为我认为它仅对包含公式的单元格无效。
有人使用一些更稳定的公式或UDF吗?
答案 0 :(得分:0)
类似的方法可行,但要取决于工作表上是否没有“干扰”内容:
2019-03-19 17:32:31.762 17365-17365/com.fan4.outdoorplus E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.fan4.outdoorplus, PID: 17365
java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.Serializable android.os.Bundle.getSerializable(java.lang.String)' on a null object reference
at com.fan4.outdoorplus.WeatherFragments.DisplayWeatherFrag.onActivityCreated(DisplayWeatherFrag.java:68)
at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:2460)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1483)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:620)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
at android.app.Activity.performStart(Activity.java:7157)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2937)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2019-03-19 17:32:31.849 1932-2013/system_process E/InputDispatcher: channel '9ab1457 PopupWindow:1c45845 (server)' ~ Channel is unrecoverably broken and will be disposed!
2019-03-19 17:32:31.850 1932-2013/system_process E/InputDispatcher: channel '8221b13 com.fan4.outdoorplus/com.fan4.outdoorplus.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2019-03-19 17:32:32.061 2592-2866/com.google.android.googlequicksearchbox:search E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
2019-03-19 17:32:32.061 2592-2866/com.google.android.googlequicksearchbox:search E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da